Playing Ogg Sound in Android
Posted
by
baba tenor
on Stack Overflow
See other posts from Stack Overflow
or by baba tenor
Published on 2012-06-19T01:25:46Z
Indexed on
2012/06/19
3:16 UTC
Read the original article
Hit count: 219
In my application, I am trying to play a sound file in ogg format, stored in raw folder in res directory of my application. When I press the button that calls below function, it just freezes with the button pressed and does not respond. In the end, I have to terminate the application from Eclipse. Nothing about an error or exception in Logcat.
In debugging mode, it enters create function and never comes back. What am I doing wrong?
private void playbeep()
{
mPlayer = MediaPlayer.create(this, R.raw.beep);
mPlayer.start();
mPlayer.release();
}
© Stack Overflow or respective owner