audio plays too fast and has tinny sound

Hi,

I’m trying to add some music to my app.

Someone has created a .wav file for me.  It works well in the simulator, but when I put it on my android device (samsung mini) the music is really fast (like it’s in fast forward mode) and sounds tinny.

Any suggestions?  I can’t upload it here because the file size is too big.

thanks

In your config.lua file, check to see if you have an audioPlayFrequency table entry there.  Looks like it is no longer used in the Corona SDK, so if it is still there, verify that it matches the encoding of the WAV file you are using.  Or just get rid of it.

As a test, you could also try converting the WAV file to an MP3 file and see if it plays correctly that way.  If it did, then the problem might be either an issue in the original WAV file, or an issue with the size of the sound file on your device.

You could also post some code about how you are playing the file.  Maybe one of the Corona folks, or someone else, will see a problem with the code you are using.

Hi,

Nothing in the config file.

Code is:

themeSong = audio.loadSound(“sounds/themesong.wav”)

themeSongChannel = audio.play(themeSong, {loops=-1})

I’ll try the conversion and see what happens.

thx

" I can’t upload it here because the file size is too big."

Which is why you should prefer MPEG 4 audio format for iOS, Ogg Vorbis for Android.   WAV is not compressed and will blowout the size of your upload to the app store.  

In your config.lua file, check to see if you have an audioPlayFrequency table entry there.  Looks like it is no longer used in the Corona SDK, so if it is still there, verify that it matches the encoding of the WAV file you are using.  Or just get rid of it.

As a test, you could also try converting the WAV file to an MP3 file and see if it plays correctly that way.  If it did, then the problem might be either an issue in the original WAV file, or an issue with the size of the sound file on your device.

You could also post some code about how you are playing the file.  Maybe one of the Corona folks, or someone else, will see a problem with the code you are using.

Hi,

Nothing in the config file.

Code is:

themeSong = audio.loadSound(“sounds/themesong.wav”)

themeSongChannel = audio.play(themeSong, {loops=-1})

I’ll try the conversion and see what happens.

thx

" I can’t upload it here because the file size is too big."

Which is why you should prefer MPEG 4 audio format for iOS, Ogg Vorbis for Android.   WAV is not compressed and will blowout the size of your upload to the app store.