GLBasic forum

Main forum => GLBasic - en => Topic started by: galiksoft on 2012-Oct-22

Title: Sound incorrectly played in Android
Post by: galiksoft on 2012-Oct-22
Hi people.

Why my explosion sound is incorrectly played in android? It is correctly played in windows.
Check the sound: http://galiksoft.is-great.org/explosion.wav

Make a simple project like this bellow and compile both for windows and for android and run it
Code (glbasic) Select

LOADSOUND "explosion.wav",1,1
PLAYSOUND(1,0, 0.5)
CLEARSCREEN RGB(255,0,0)
SHOWSCREEN
mousewait


As you can conclude, the explosion sound is not well played in android.
Why?
What can I do? I need exactly an explosion sound for my new bombs game.

Please help me
Thanks
Title: Re: Sound incorrectly played in Android
Post by: okee on 2012-Oct-22
Convert to ogg format using Audacity
Title: Re: Sound incorrectly played in Android
Post by: spacefractal on 2012-Oct-22
cant download this one. I either just got ads or I just go to the webhost main site. So reupload again. Howover have you try to use 16bit 22khz?

By now I cant recommered to convert to ogg for soundfx as I aware only works for music commands, not sound?

PS. Which device are you using?
Title: Re: Sound incorrectly played in Android
Post by: galiksoft on 2012-Oct-22
But if I convert to ogg format, I can't use playsound command because it only plays sounds in wav format...
Title: Re: Sound incorrectly played in Android
Post by: galiksoft on 2012-Oct-22
No real device.

Just AVD (Android Emulator) and Bluestacks.


The links works: Copy the url and paste it to the browser url bar...
Title: Re: Sound incorrectly played in Android
Post by: spacefractal on 2012-Oct-22
That why. It's property a emulation issue. Don't trust the emulator, which is very imperfect.

Much better test on a real device.

Reupload again and I test on my device (trying again when home).
Title: Re: Sound incorrectly played in Android
Post by: spacefractal on 2012-Oct-22
just tested. Its a encode error in your wav. I just got noise in "my" loant HTC Desire HD (which elsewise play sound very nice without issues).

I guess its property due the bitate, which is 11127hz. that bitrate is nonestandard and you need to reencode to a standard wav bitrate (such of 11025hz, 22050hz or 44100hz). Its also 8 bit, while I use 22khz 16bit mono myself for all soundfx for compatible.