audioplayers
audioplayers copied to clipboard
Can not get duration before audio play
After setting the source I am trying to get the duration of the audio file. Unfortunately, the answer is zero.
The code:
await player.setSource(event.source);
var duration = await player.getDuration();
Platforms OS: Windows & Android
This cannot be guaranteed in all cases. The problem is e.g. for mp3 the duration is estimated which only will precisely work if playing the audio. But I didn't experience that on Android/Windows yet...
I have the same issue here, just_audio offer get duration before we play audio, but there is already to much code I implement using audio_player
Closing in favor of #1033