Home Tutorials Download Beta Store Forum Documentation KnowledgeBase Wiki Blog

ShiVa3D

Return to Google Android

Sound quality for android  [SOLVED]

Google Play Store, Amazon Kindle, Nook, and so many more

Sound quality for android

Postby liechten » 20 Jul 2012, 17:41

Hi guys,

I have a problem with playing sounds on Android.
I have many level scenes and several scenes for menus.
And 2 types of background music - for scenes and for menu.
Now, I've imported 2 mp3 files with original bitrate and quality = 10.
And they play fine if I build for Playbook.
However, on Android I've noticed that they do not always start to play for while I switch between menus and levels.
Sounds are not very big - like 50 KB each. So, I don't think that is a problem.
Also, I've noticed that if during the import I set bitrate 8kbps and quality =5 they play always correctly on Android, however, the sound quality is not acceptable.

Can you please, advice on what is the best format/options/settings for importing sounds into the application?
If you need any more details - please, let me know.

Thanks,
Artem
liechten
Fresh Boarder
Fresh Boarder
 
Posts: 11

Re: Sound quality for android

Postby capiright » 20 Jul 2012, 21:56

Are you talking about a delay?
Are you using the Sound API for all sound or are you also using Music API?
Are you using the OpenAL option in the UAT?

Also try using WAV as source. I found them to be much better for importing.
User avatar
capiright
Platinum Boarder
Platinum Boarder
 
Posts: 518

Re: Sound quality for android

Postby Fraser » 20 Jul 2012, 23:46

capiright wrote:...try using WAV as source. I found them to be much better for importing.


Yes, and for phone games I use thes import settings for sound and music:

Mono
Radio (22KHz)
Quality 10

and before impoirting WAVs then apply very short end fades to the sample to stop clicks
Fraser Ashworth,
https://www.cortex7.net
User avatar
Fraser
Platinum Boarder
Platinum Boarder
 
Posts: 1105
Location: Europe

Re: Sound quality for android

Postby capiright » 21 Jul 2012, 08:10

Actually my source files are all stereo 44.1mhz. I use all factors as keep as original except the quality which is 8.

IF your sources are fine you should not have a click at the end, regardless of the fade. I actually had the clicks when I used mp3 as source.
User avatar
capiright
Platinum Boarder
Platinum Boarder
 
Posts: 518

Re: Sound quality for android

Postby liechten » 23 Jul 2012, 10:00

capiright wrote:Are you talking about a delay?


I'm talking about music playing/not playing randomly with different sound file settings.

capiright wrote:Are you using the Sound API for all sound or are you also using Music API?


I was using Sound API for all sounds.

capiright wrote:Are you using the OpenAL option in the UAT?


I tried to use this option. And it played correctly when the sounds quality was very bad.
But when I tried quality=10 and other default settings for MP3 files - OpenAL option did not make any difference.

capiright wrote:Also try using WAV as source. I found them to be much better for importing.


I will try this. Thanks for the tip.
liechten
Fresh Boarder
Fresh Boarder
 
Posts: 11

Re: Sound quality for android

Postby freezer » 23 Jul 2012, 23:38

liechten wrote:...
However, on Android I've noticed that they do not always start to play for while
...


I thought I had a similar issue, but it turned out i'd told the sample to start in time with another loop. But to start with I tried caching the sample on init...

Code: Select all
    if(cache.getFileStatus("packagepick_01_01.snd")<0) then
        cache.addFile("packagepick_01_01.snd", "packagepick_01_01.snd")
    end
freezer
Gold Boarder
Gold Boarder
 
Posts: 216

Re: Sound quality for android

Postby liechten » 26 Jul 2012, 14:17

Looks like my issue is related to this thread:
http://www.stonetrip.com/developer/forum/viewtopic.php?f=43&t=22088

Does anyone know if this problem has been resolved for Android devices?

Thanks!
liechten
Fresh Boarder
Fresh Boarder
 
Posts: 11

Re: Sound quality for android  [SOLVED]

Postby capiright » 30 Jul 2012, 07:32

Ok, I wish I had a link to that but I misplaced it. There is a description of Android SDK audio libraries and their properties. There are three: sound effects, stream audio and another one which I forgot but but it's also for music playback.
In there there are also specifications on best quality and sizes. I think you should Google it.

Basically a sound file cannot be larger than 1 mg UNCOMPRESSED. Using mp3 to work around will not help (Shiva is actually using ogg so the sound files here are smaller than they are).
Make sure all your WAV or other PCM file types are below 1 mg before playing them. To play larger files use the music API.

My tests with OpenAL made me drop that option: the lags were massive and even though on my HTC it was bearable, on a Galaxy device it was just horrible
User avatar
capiright
Platinum Boarder
Platinum Boarder
 
Posts: 518

Re: Sound quality for android

Postby liechten » 30 Jul 2012, 13:37

Yeah, although, my background music was less than 200 KB in WAV format, I had to re-implement the solution using Music API.
Looks like the best thing to do - is to implement all music using Music API and all effects using Sound API.

Regards,
Artem
liechten
Fresh Boarder
Fresh Boarder
 
Posts: 11


Return to Google Android