Maybe try starting the audio in a background thread?
On Thursday, August 16, 2012 10:08:05 PM UTC-5, johnsin wrote: > > Conversion to OGG didn't work for me.. so I am in the same boat as you.. > Did anyone get anywhere with this? > > On Tuesday, May 11, 2010 5:35:55 AM UTC-7, Jason wrote: >> >> Hi all, >> >> I am having an issue with a looping audio file using MediaPlayer. I >> am developing a realtime game and have a 100K MP3 file I want to loop >> as background music. The size of the file means I can't pre-load into >> memory (using SoundPool) so I am using the MediaPlayer to stream the >> data. >> >> All works fine, however if I set the stream to loop >> (MediaPlayer#setLooping(true)) when the stream gets to the end and >> MediaPlayer loops, I get a distinct pause in gameplay. Everything >> seems to hang for a good chunk of time (~100ms) presumably while >> MediaPlayer re-seeks to the start of the audio file, and this is >> killing my framerate and making the game unplayable at these points. >> >> There doesn't seem to be a way to configure any memory buffers etc on >> the MediaPlayer, so I'm wondering if I am using the wrong approach? >> >> Any other ways to run continuous background music? >> >> Thanks, >> >> Jason. >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Android Developers" group. >> To post to this group, send email to android-d...@googlegroups.com >> To unsubscribe from this group, send email to >> android-developers+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en