MediaPlayer really wasn't intended to be used that way. But maybe we can help you get past the problem.
What kind of file is R.raw.squash? If it's an MP3, you'll probably have better results with Ogg files, the Ogg playback engine is considerably smaller and more robust. We have new API's for sound effects coming in the Cupcake SDK. On Feb 18, 3:41 am, vir <[email protected]> wrote: > Hello people, > This is my first post on android-framework. I am having a problem > while playing sound with mediaplayer. > the scenario is like this : > > I have an application where the user have to click on images on the > screen and it plays a sound on click event. The problem is that when i > click very quickly 20 - 30 times at one go, i am getting this error : > > WARN/WindowManager(): Key dispatching timed out sending to com.XYZ > INFO/ActivityManager(): ANR (application not responding) in process: > com.XYZ > INFO/ActivityManager(): Annotation: keyDispatchingTimedOut > > i am using this code to play sound on click event :: > > private void media(){ > if (mMediaPlayer != null) { > mMediaPlayer.stop(); > mMediaPlayer.release(); > } > > mMediaPlayer = MediaPlayer.create(this, R.raw.squash); > > mMediaPlayer.start(); > > } > > Any help will be really Appreciated. > > Thanks & regards :) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "android-framework" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-framework?hl=en -~----------~----~----~----~------~----~------~--~---
