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
When the Symphonia stream is seeked, it does not in general advance to the position requested, but rather to a packet boundary less than or equal to that position. However the Symphonia decoder in creek does not currently use the return value, resulting in duplicate chunks of audio in the stream.
Note: The FormatReader by itself cannot seek to an exact audio frame, it is only capable of seeking to the nearest Packet. Therefore, to seek to an exact frame, a Decoder must decode packets until the requested position is reached. When using the accurate SeekMode, the seeked position will always be before the requested position. If the coarse SeekMode is used, then the seek position may be after the requested position. Coarse seeking is an optional performance enhancement, therefore, a coarse seek may sometimes be an accurate seek.
In practice, this results in an audible glitch in playback at around 11 seconds into the stream if you are using a similar setup to the Player demo.
The seek offset can also be seen in debug logs from the Symphonia library, for example for this MP3 of Carlie Rae Jepsen's "Emotion":
[2023-08-26][22:38:11][DEBUG][symphonia_bundle_mp3::demuxer] seeking to ts=0 (+0 delay = 0)
[2023-08-26][22:38:11][DEBUG][symphonia_bundle_mp3::demuxer] found frame with ts=0 (0) @ pos=11558 with main_data_begin=0
[2023-08-26][22:38:11][DEBUG][symphonia_bundle_mp3::demuxer] seeked to ts=0 (0) (delta=0)
[2023-08-26][22:38:11][DEBUG][symphonia_bundle_mp3::demuxer] seeking to ts=458752 (+0 delay = 458752)
[2023-08-26][22:38:11][DEBUG][symphonia_bundle_mp3::demuxer] found frame with ts=458496 (458496) @ pos=427427 with main_data_begin=480
[2023-08-26][22:38:11][DEBUG][symphonia_bundle_mp3::demuxer] will seek -1 frame(s) to ts=457344 (457344) @ pos=426382 (-1045 bytes)
[2023-08-26][22:38:11][DEBUG][symphonia_bundle_mp3::demuxer] seeked to ts=457344 (457344) (delta=-1408)
I've attempted to fix this with jacobstern@10b989a in my fork, but this seems to have introduced an artifact at the end of playback for a track, probably because the bookkeeping of chunk durations is still off.
Any assistance with the fix would be appreciated. Thanks!
The text was updated successfully, but these errors were encountered:
When the Symphonia stream is seeked, it does not in general advance to the position requested, but rather to a packet boundary less than or equal to that position. However the Symphonia decoder in
creek
does not currently use the return value, resulting in duplicate chunks of audio in the stream.https://docs.rs/symphonia-core/0.5.3/symphonia_core/formats/trait.FormatReader.html#tymethod.seek
In practice, this results in an audible glitch in playback at around 11 seconds into the stream if you are using a similar setup to the Player demo.
The seek offset can also be seen in debug logs from the Symphonia library, for example for this MP3 of Carlie Rae Jepsen's "Emotion":
I've attempted to fix this with jacobstern@10b989a in my fork, but this seems to have introduced an artifact at the end of playback for a track, probably because the bookkeeping of chunk durations is still off.
Any assistance with the fix would be appreciated. Thanks!
The text was updated successfully, but these errors were encountered: