ExoPlayer: get mp3/flac duration without playback

293 Views Asked by At

Is there any way to get/calculate audio file duration with ExoPlayer library WITHOUT file playback?

Android has MetadataRetriever.extractMetadata(METADATA_KEY_DURATION).

But I use exoplayer2.MetadataRetriever.retrieveMetadata​(MediaSourceFactory mediaSourceFactory, MediaItem mediaItem) - in my opinion it works faster for remote files.

But I didn't found duration field in response mp3 (TLEN) or flac, it simply missing this fields.

Does exoplayer - have alternate way, or any fields where we calculate audio file duration?

0

There are 0 best solutions below