You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which API doesn't behave as documented, and how does it misbehave? AudioPlayer.duration, AudioPlayer.durationStream: Do not reflect the actual duration of the mp3. In the example 22kHz mono mp3 below, the actual duration of the file is 4:09 (based on play time as well as pulling duration from ffmpeg metadata), but the reported duration is over 18minutes AudioPlayer.seek, AudioPlayer.positionStream: When seeking to a position greater than the current bufferedPosition in a 22kHz mono mp3 (see url below), the position is reported correctly as the duration that was passed to the seek method, but the audio playing is not from that part of the mp3. In the example of the url below, if I seek to Duration(seconds: 120) when that position is greater than the bufferedPosition, the audio plays from roughly the 30s position, even though the positionStream reports an advancing play from 120s on.
To Reproduce (i.e. user steps, not code)
Steps to reproduce the behavior:
To observe the incorrect duration value:
Create the audio source with the supplied URI
Pass the source to the player and begin playback
Accessing a non-null duration will show a value over 18 minutes.
To observe the incorrect position on seek:
Initialize the source and player as above, and then after playing, immediately seek to a position outside of the bufferedPosition (such as 120s).
The audio playback will be from roughly the 30s mark in the file, even though the positionStream will continue to be updated with values starting at 120s and incrementing.
Error messages
no error messages
Expected behavior
The duration should match the actual play back time of the file, or the time contained in the metadata extracted by ffmpeg, which in this example are the same.
When seeking to a position greater than the current bufferedPosition, the player should start playing the audio correctly from the position requested.
Screenshots
N/A
Desktop (please complete the following information):
OS: N/A
Browser N/A
Smartphone (please complete the following information):
Device: Samsung Galaxy A15 5G
OS: Android 14
Flutter SDK version
[✓] Flutter (Channel stable, 3.19.3, on macOS 14.2.1 23C71 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] VS Code (version 1.89.1)
[✓] Connected device (5 available)
[✓] Network resources
@amenders, and I are working on the same app together. So, that's why the audio urls are from the same api. Both the track @amenders put in his original post and this one are having the same issue with incorrect durations on both of our machines.
Were you able to resolve this issue? I am experiencing similar behaviour in my project as well. For me duration is working just fine, but seek plays different portion of the audio.
Which API doesn't behave as documented, and how does it misbehave?
AudioPlayer.duration
,AudioPlayer.durationStream
: Do not reflect the actual duration of the mp3. In the example 22kHz mono mp3 below, the actual duration of the file is 4:09 (based on play time as well as pulling duration from ffmpeg metadata), but the reportedduration
is over 18minutesAudioPlayer.seek
,AudioPlayer.positionStream
: When seeking to a position greater than the currentbufferedPosition
in a 22kHz mono mp3 (see url below), the position is reported correctly as the duration that was passed to theseek
method, but the audio playing is not from that part of the mp3. In the example of the url below, if I seek toDuration(seconds: 120)
when that position is greater than thebufferedPosition
, the audio plays from roughly the 30s position, even though thepositionStream
reports an advancing play from 120s on.Minimal reproduction project
The example. Use the following url as a
AudioSource.uri
orProgressiveAudioSource
:"https://appdata.jesuslifetogether.com/appdatafiles/mp3s/audio/1164_lilies_sparrows_dont_have_energy_leaks/las05t_the_conservation_of_energy.mp3"
To Reproduce (i.e. user steps, not code)
Steps to reproduce the behavior:
To observe the incorrect
duration
value:To observe the incorrect position on
seek
:bufferedPosition
(such as 120s).positionStream
will continue to be updated with values starting at 120s and incrementing.Error messages
Expected behavior
The
duration
should match the actual play back time of the file, or the time contained in the metadata extracted by ffmpeg, which in this example are the same.When seeking to a position greater than the current
bufferedPosition
, the player should start playing the audio correctly from the position requested.Screenshots
N/A
Desktop (please complete the following information):
Smartphone (please complete the following information):
Flutter SDK version
Additional context
Additional minimal repro link:
https://github.com/amenders/just_audio_example
The text was updated successfully, but these errors were encountered: