Is it possible to play 2 mp3s files at the same time?
I got 2 mp3s files, one for background music and the other is a message I want to play. This works well on the simulator but when ported to a HTC Desire, it only plays the mp3 file that was first called.
I am using
media.playSound(‘MessageToBePlayed.mp3’);
media.playSound(‘BackgroundMusicToBePlayed.mp3’);
I have even converted the 2 files into 1 mp3 file and that also works in the simulator but on the HTC Desire it stops playing after the MessageToBePlayed part has finished!!!
I dont mind if I can get the MessageToBePlayed.mp3 played first and then the BackgroundMusicToBePlayed.mp3 to be played straight after.
Any help or advice would be greatly appreciated.
Thanks in advance
Sai
[import]uid: 39797 topic_id: 8051 reply_id: 308051[/import]
You need to use the new audio.play if you have to play more than 1 sound at a time. The audio.play api’s isnt great on android and there are reports of delay before the mp3 plays. I suggest you use audio.play for the background music - where a start delay isn’t a major issue and keep using media.play for the message sounds
If you want to play them one after the other with media.playsound, you need to make sure the first ended first, plus about 50ms in my experience. [import]uid: 8872 topic_id: 8051 reply_id: 28796[/import]