I\'m using a SoundPool to play audio clips in my app. All is fine but I need to know when the clip playback has finished.
At the moment I track it in my app by obta
Did you try this:
String mediaPath = Uri.parse("android.resource:///raw/filename").getPath();
MediaMetadataRetriever mmr = new MediaMetadataRetriever();
mmr.setDataSource(mediaPath);
String duration = mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION);
mmr.release();
But i am not exactly sure that this is lighter than exisiting code.