[android-developers] Re: MediaPlayer sluggish to play sounds

2009-06-30 Thread Mark Murphy
Baratong wrote: I actually tried that one first and found the soundpool to be a little less than ready for primetime... it didn't work reliably in my testing and even crashed from time to time. After that I went back to trying to solve the MediaPlayer audio system wake-up issue. I'm building

[android-developers] Re: MediaPlayer sluggish to play sounds

2009-06-29 Thread Marco Nelissen
On Sat, Jun 27, 2009 at 1:08 PM, Baratongpwalter...@gmail.com wrote: I've found the audio subsystem is a little quirky. It's great if you are playing songs, or video but if you are writing a game that plays short sounds quickly it poses problems. After much work I found a pretty cool

[android-developers] Re: MediaPlayer sluggish to play sounds

2009-06-29 Thread Paul Kilgo
On Sat, Jun 27, 2009 at 3:08 PM, Baratong pwalter...@gmail.com wrote: What I ended up doing was this: 1. Use Audacity to create a 1-second .wav of total silence and add the wave into my manifest as a raw resource referenced in the app as R.raw.silence. 2. On startup, create a MediaPlayer

[android-developers] Re: MediaPlayer sluggish to play sounds

2009-06-29 Thread Mark Murphy
Baratong wrote: I've found the audio subsystem is a little quirky. It's great if you are playing songs, or video but if you are writing a game that plays short sounds quickly it poses problems. After much work I found a pretty cool solution to one of the annoying problems of MediaPlayer

[android-developers] Re: MediaPlayer sluggish to play sounds

2009-06-29 Thread Baratong
In this code I merely place the sound in the 'pause' state as I simply want to unpause with the 'start()'. Doing a start on a paused MediaPlayer instance does not reload the sound but simply changes state back to 'Started' which makes it begin playing again thus waking up the audio system. (see

[android-developers] Re: MediaPlayer sluggish to play sounds

2009-06-29 Thread Baratong
I actually tried that one first and found the soundpool to be a little less than ready for primetime... it didn't work reliably in my testing and even crashed from time to time. After that I went back to trying to solve the MediaPlayer audio system wake-up issue. I'm building under the Android

[android-developers] Re: MediaPlayer sluggish to play sounds

2009-06-29 Thread Baratong
Actually what you described is exactly how I handle the audio in this app. It's a video poker app but I preload all sounds and even on payout sounds of the coins dropping I load 4 instances of it so they can overlap while the game is in that mode. What I found was after 3 seconds of no audio at

[android-developers] Re: MediaPlayer sluggish to play sounds

2009-04-01 Thread Alexey
I think you have to get WakeLock to avoid your media stop when phone is going to sleep. Try to use setWakeMode() method of MediaPlayer or if it won't help for some reason, you can use PowerManager/WakeLock classes directly. On 1 апр, 04:35, Eric M. Burke burke.e...@gmail.com wrote: I have an

[android-developers] Re: MediaPlayer sluggish to play sounds

2009-04-01 Thread Marco Nelissen
I'm surprised that calling start() has no effect, and that it takes several seconds for playback to work again. Do you have the same issue when playing a file in the music player, for example? On Tue, Mar 31, 2009 at 5:35 PM, Eric M. Burke burke.e...@gmail.com wrote: I have an Activity that

[android-developers] Re: MediaPlayer sluggish to play sounds

2009-04-01 Thread Dave Sparks
Agreed. It takes about 100 msecs to spin up the audio output once it goes to standby. You will seeing something like this in the log: W/AudioFlinger( 35): write blocked for 103 msecs If it's taking several seconds, there must be something else involved. On Apr 1, 11:51 am, Marco Nelissen