Android sound limit
I am trying to create a piano app for the Android.
I use Titanium.Media.createSound({ url:'sounds/xxx.mp3' });
to create the sound elements, then use .play
to play them.
The app only plays the first 7 keys I hit, no matter the order, then silence. I can still hit the ones I hit before, and the sound will play, but no more.
I tried using preload:true
and createAudioPlayer
too, but no luck. On the iPhone everything works fine. I don't think it's some memory issue since I tested it on the emulator, and actual devices (Nexus One and more).
Update: Also tried using one Sound element and changing its url - no luck either.
I guess it's the Android's prob.
3 Answers
-
Please post your code (preferably to git gist).
Is adb -e logcat displaying any errors or other information? -
Answering my own question, it was not the code that there was a problem in, but the sound format.
It seems Android doesn't really like .mp3, so converting my sound files to .ogg, everything worked fine.
Tested successfully on the emulator, I guess it will be the same on the device. -
That's strange - mp3s are playing for me. There are also examples in the KitchenSink in the scripts sound_remote.js and sound_session_mode.js. Does either of these work in your environment?
Hal