开发者

FileNotFound Exception MediaPlayer android

I have a1.ogg in the res/raw file

try {
    mp = MediaPlayer.create(this, R.raw.a1);      
} catch (Exception e)
{ Log.e("msg",e.getMessage());  }

Give me java.i开发者_StackOverflow社区o.FileNotFoundException

The same file in wav format work


Try this:

MediaPlayer mp = new MediaPlayer();

mp.setDataSource("/data/test.ogg"); // replace with correct location
mp.prepare();
mp.start();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜