Loading sound fails. Need help.

I’ve been adding sound and music to the game, and some work and some don’t.   They are all .wav format and I get this error for at least 3 sound/music files while the others work fine. File names match. Any ideas?

 

23:49:11.587 WARNING: C:\Users\Didier\Documents\Corona Projects\SpeedyBird\mainGame.lua:505: audio.loadStream() failed to create stream 'Inspired (Happy-Pop).wav' 23:49:14.508 WARNING: C:\Users\Didier\Documents\Corona Projects\SpeedyBird\restart.lua:106: audio.loadSound() failed to create sound 'menuSelect.wav' 23:49:14.518 WARNING: C:\Users\Didier\Documents\Corona Projects\SpeedyBird\restart.lua:107: audio.loadStream() failed to create stream 'funkyRooster.wav'

Some of the code: 

 

menuSelect = audio.loadSound("menuSelect.wav") restartSound = audio.loadStream("funkyRooster.wav")

audio.play(restartSound, {channel = 2})

audio.stop(1) audio.stop(2) audio.dispose(menuSelect) audio.dispose(restartSound) menuSelect = nil restartSound = nil

I think the first thing is to make sure you have valid .wav files.  Are they stereo or mono tracks? Do they have Dolby surround sound (even though if you’re using a modern version of Corona we should handle those)?  What is the sample rate?  11050hz, 22khz, 44khz or some other value?

Rob

The “funkyRooster.wav” and “Inspired (Happy-Pop).wav” info are as follows:

Codec: 32 bits float LE (f32I) Channels: Stereo Sample Rate: 44100 Hz Bits per sample: 32

The menuSelect.wav info is as follows:

 

Codec: PCM S24 LE (s24I) Sample Rate: 44100 Hz Bits per Sample: 24 Bitrate: 2116 kb/s

Those values seem reasonable. What happens if you try to substitute them in a couple of our Sample apps that demo playing audio?

Rob

I saw in the demos that some projects were using .mp3 formats, so I used an online converter and changed the .wav’s to .mp3 and they seem to work now.  Thanks for sending me in the right direction. 

I think the first thing is to make sure you have valid .wav files.  Are they stereo or mono tracks? Do they have Dolby surround sound (even though if you’re using a modern version of Corona we should handle those)?  What is the sample rate?  11050hz, 22khz, 44khz or some other value?

Rob

The “funkyRooster.wav” and “Inspired (Happy-Pop).wav” info are as follows:

Codec: 32 bits float LE (f32I) Channels: Stereo Sample Rate: 44100 Hz Bits per sample: 32

The menuSelect.wav info is as follows:

 

Codec: PCM S24 LE (s24I) Sample Rate: 44100 Hz Bits per Sample: 24 Bitrate: 2116 kb/s

Those values seem reasonable. What happens if you try to substitute them in a couple of our Sample apps that demo playing audio?

Rob

I saw in the demos that some projects were using .mp3 formats, so I used an online converter and changed the .wav’s to .mp3 and they seem to work now.  Thanks for sending me in the right direction.