How to play .rm files in android?
MediaPlayer plays .mp3 files without any problem. But during playback of .rm files this is an exception.
code:
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);
}
An exception:
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
+3
user1664942
source
to share
2 answers
RealMedia ( .rm
) is not one of the Android supported media formats .
+2
CommonsWare
source
to share
You need to create it.
public static MediaPlayer create (Context context, int resid)
0
Guilherme Gregores
source
to share