Game crash due to sounds used

Hi,

I am developing a game with 10 levels.There are several sounds used. But, I am unable to play all 10 levels in a shot. Game crashes in between. And If I remove sounds, game runs well and can play all levels.
I have written different lua file for sound load and play.All sounds are loaded at time in the beginning of the game and then using them whenever needed. Code is something like this :
local extension = “.mp3”;
local soundChannel

–creating table with all sounds loaded
local soundTable = {
[“sound_1”] = audio.loadSound(“sound_1”…extension),
[“sound_2”] = audio.loadSound(“sound_2”…extension),
[“sound_3”] = audio.loadSound(“sound_3”…extension),
[“sound_4”] = audio.loadSound(“sound_4”…extension)
– more 15 sounds clips loads here
}

function playSound(soundName)
soundChannel = audio.findFreeChannel()
audio.play( soundTable[soundName], {channel = soundChannel } )

return;
end
– this function is calling from different places in game
playSound(“sound_1”);
right now i am not disposing the sound b’coz these sounds are reusable.Can anybody tell what is wrong with this? And why game might be crashing?

Thanks. [import]uid: 68306 topic_id: 14903 reply_id: 314903[/import]

what is the size of this sound files may be u r going out of memory

:slight_smile: [import]uid: 12482 topic_id: 14903 reply_id: 55054[/import]

Also for mp3 files and large audio files use

audio.loadStream  

that streams the audio rather than loading the entire file into memory. [import]uid: 84637 topic_id: 14903 reply_id: 55057[/import]

Hi hgvyas123,

total size of audio files is 9957KB :slight_smile: but rest of the game is pretty heavy.

Thanks again. [import]uid: 68306 topic_id: 14903 reply_id: 55670[/import]

@Danny,
Thanks for reply… will definitely try with loadStream. [import]uid: 68306 topic_id: 14903 reply_id: 55671[/import]

Hi,
We are using Corona SDK to create EBooks, and for each screen we are using a .mp3 file for the voice over.

But when we test it on the simulator, as we navigate across the screens, the sounds change.

But on the phone, after the first sound no other sound plays and at time the app crashes also.

It works just great on the simulator, but not on the phone.

Any others who have faced similar issues and have found a solution.

Sunil [import]uid: 56933 topic_id: 14903 reply_id: 56931[/import]