Android : InputStream of mp3 file to MediaPlayer

on Monday, November 10, 2014


My humble mp3 file: enter image description here


And the code to play the mp3 file: (I get a file doesnt exist error )



MediaPlayer mp = new MediaPlayer();

FileInputStream fis = (FileInputStream) getAssets().open("skase.mp3");
mp.setDataSource(fis.getFD());
mp.prepare();
mp.start();

0 comments:

Post a Comment