Problem with music file on IPad

Hi,

I’ve started testing my game on Apple hardware and ran into a problem with my background music.
On android devices and on Corona Simulator (both win and mac) I can hear the background music (.mp3 files). However, when I compile for xcode or IPad and run the game, I do not hear the background music at all. I can hear the sound effects (also mp3 mostly), but for some reason the background music files are either not playing or not heard. I didn’t see any errors on the console as well. I’ve also tried loading the background mp3 files using loadSound instead of loadStream but the result is the same.
Has anyone encountered this before?

Thanks.
[import]uid: 118978 topic_id: 27820 reply_id: 327820[/import]

Hi Rune,

Sorry for the slightly slow response, I had to talk to Eric (our audio guru) to get some advice about this as I haven’t encountered the issue before.

Here is what he had to say;
“I’m a little surprised it works on Mac but not iOS because both use the same Apple code to decode, but Apple does have differences in their own code for the platforms. I would convert to .wav and see what happens. The other guess is that they are trying to simultaneously play more than one MP3, AAC, or other format that requires the hardware accelerated decoder on iOS and the operating system is just not playing it instead of falling back to software. Again, WAV avoids this problem because it doesn’t use the hardware decoder.”

Could you give that a go and let me know how you go, please?

Peach :slight_smile: [import]uid: 52491 topic_id: 27820 reply_id: 112854[/import]

Hi Peach,

Thanks. Your remark put me on the right track. I’ve checked my audio files with a sample project and everything played nicely, so I was looking for some resource collision as you suggested.
After some trials and prints :), I found out I was placing the wrong file only on iOS, due to very old piece of code (note to self, never add a function if you’re not using it immediately…)

So, problem solved. thanks again for the tip.

[import]uid: 118978 topic_id: 27820 reply_id: 112928[/import]

Fantastic, I’m very happy to hear that :slight_smile: (Although all credit goes to Eric, he’s the audio expert.)

Good luck with the rest of your project!

Peach :slight_smile: [import]uid: 52491 topic_id: 27820 reply_id: 112941[/import]