trying to do something like a player. Plays. But I can not extract any information about the file. On the English forum there are examples but with uri and the MediaMetadataRetriever class in which I can not find a suitable constructor that accepts a media file. How do I read info about the audio that is playing? the service itself that loses me looks like this.
public class service extends Service{ static String str; static int pos; MediaPlayer media = new MediaPlayer(); MediaMetadataRetriever metaRetriever = new MediaMetadataRetriever(); @Override public IBinder onBind(Intent arg0) {return null;} @Override public void onCreate() { super.onCreate(); media = MediaPlayer.create(this,R.raw.arena); metaRetriever.setDataSource(getPackageResourcePath()); str = metaRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_BITRATE);// никакую инфу не дает media.start(); } @Override public void onDestroy() { media.stop(); media=null; super.onDestroy();} }