MediaPlayer 播放 .mp3 文件没有任何问题。但是在播放 .rm 文件时,它会通过异常。
代码:
try{
AssetFileDescriptor afd = getAssets().openFd("song.rm");
MediaPlayer player;
player = new MediaPlayer();
player.setDataSource(afd.getFileDescriptor(),afd.getStartOffset(),afd.getLength());
player.prepare();
player.start();
} catch(Exception e){
System.out.println("Exception while Playing: "+e);
}
例外 :
01-30 16:42:11.126: E/MediaPlayer(1404): Unable to to create media player
01-30 16:42:11.126: I/System.out(1404): Exception while Playing : java.io.IOException: setDataSourceFD failed.: status=0x80000000