I’m trying to put a soundtrack into my game. The file is an .mp3. I’m using :
[lua]audio.loadSound()[/lua]
and then I’m using
[lua]audio.play()[/lua]
The sound successfully plays in the simulator but when I build it for my phone, It doesn’t play. What am I doing wrong? [import]uid: 29181 topic_id: 9384 reply_id: 309384[/import]
I am facing the similar problem. I have integrated .mp3 file using audio.loadSound() & audio.play() methods. The sound plays fine on iPhone & iPod. But it is not working on Android device.
One thing to check is look inside the .apk to make sure that the sound file was included correctly. If not then check your file names very carefully for upper/lowercase. Also your sound files cannot be in a subdirectory in your project, they must be at the same level as your main.lua file. [import]uid: 6787 topic_id: 9384 reply_id: 37861[/import]
You might try re-converting the file to mp3 using a different encoder. It is possible you are not using an mp3 but something else like mp4 but just have the .mp3 extension. Or it is possible you are using a variant of mp3 that our Android decoder doesn’t know about but Apple’s does.
Also, you should update your Corona simulator. 2011.288 seems old and I think we have added lots of bug fixes plus better validation alert messages since then.
[import]uid: 7563 topic_id: 9384 reply_id: 38540[/import]
applause.mp3 vs. applause_mp3.mp3 is only to get around another Android limitation. You can’t have two files with the same basename or the build breaks because Android ignores the file extensions. So applause.mp3 and applause.ogg look like the same file to Android and things break.
[import]uid: 7563 topic_id: 9384 reply_id: 39036[/import]
I should reiterate that our more recent versions of the Simulators run validation tests to try to alert you (show an alert dialog) of these Android naming problems when you build for Android.
[import]uid: 7563 topic_id: 9384 reply_id: 39063[/import]