audioplayers
audioplayers copied to clipboard
Ability to read the duration of an audio file without playing it
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
+1
See: #683 #1039 #1215 #1167