Author Topic: Sound incorrectly played in Android  (Read 2599 times)

Offline galiksoft

  • Mc. Print
  • *
  • Posts: 19
    • View Profile
Sound incorrectly played in Android
« 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

Offline okee

  • Dr. Type
  • ****
  • Posts: 324
    • View Profile
Re: Sound incorrectly played in Android
« Reply #1 on: 2012-Oct-22 »
Convert to ogg format using Audacity
Android: Samsung Galaxy S2 -  ZTE Blade (Orange San Francisco) - Ainol Novo 7 Aurora 2
IOS: 2 x Ipod Touch (1G)

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3958
    • View Profile
    • Space Fractal
Re: Sound incorrectly played in Android
« Reply #2 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?
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline galiksoft

  • Mc. Print
  • *
  • Posts: 19
    • View Profile
Re: Sound incorrectly played in Android
« Reply #3 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...

Offline galiksoft

  • Mc. Print
  • *
  • Posts: 19
    • View Profile
Re: Sound incorrectly played in Android
« Reply #4 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...

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3958
    • View Profile
    • Space Fractal
Re: Sound incorrectly played in Android
« Reply #5 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).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3958
    • View Profile
    • Space Fractal
Re: Sound incorrectly played in Android
« Reply #6 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.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.