audioplayers icon indicating copy to clipboard operation
audioplayers copied to clipboard

Ability to read the duration of an audio file without playing it

Open flutternoob opened this issue 4 years ago • 1 comments
trafficstars

Ability to read the duration of an audio file without playing it

Full Description It would be great if the duration of an audio file got from assets, URIs and locally stored audio could be got without playing it.

The current method used to get the duration of an audio file after playback has begun can be retained and a separate method can be implemented to get the file's duration. A new method will eliminate the need for a breaking change for the current method used to get the audio file's duration. You could probably refer to the FFProbe class from the FFMpegKit library's docs for ideas. I do not have further knowledge to implement such a feature.

Also, due to encoding, some audio files continue to play even after their total duration has been reached. This causes min >= max error when using Slider widgets in the app. This problem does not occur on media players used in a PC environment or the music player that comes bundled with some Android devices (such as a Samsung A20). Is it possible to workaround this problem?

Platforms All platforms currently supported by audioplayers

flutternoob avatar Nov 11 '21 18:11 flutternoob

+1

yoyomyo avatar Nov 16 '21 03:11 yoyomyo

See: #683 #1039 #1215 #1167

Gustl22 avatar Sep 27 '22 16:09 Gustl22