-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to obtain the current playing time and position when rodio plays music files #457
Comments
Does the functionality in #510 fulfill the "Play Time Position"? Total Duration should be possible with It should be quite easy to add it to the symphonia decoders, as long as the relevant header parts are filled in the music files. |
Gusted
added a commit
to Gusted/rodio
that referenced
this issue
Jun 9, 2024
This adds a new PositionTrack trait which counts the amount of times `next()` is called (where it returns `Some`) and provide a function to get the position, which is a simple calculation. This is added to the Sink struct by default and the accuracy of this depends on the interval of `periodic_access`. I wasn't able to add testing to the sink counter part, because I wanted to also test `try_seek`, but it seems like I would need to have some threading code to call `next` on sink in another thread, which didn't look that good and resulted in a flaky test so only a 'unit test' in ``position.rs`. Resolves RustAudio#457 Closes RustAudio#510
Gusted
added a commit
to Gusted/rodio
that referenced
this issue
Jun 9, 2024
This adds a new TrackPosition trait which counts the amount of times `next()` is called (where it returns `Some`) and provide a function to get the position, which is a simple calculation. This is added to the Sink struct by default and the accuracy of this depends on the interval of `periodic_access`. I wasn't able to add testing to the sink counter part, because I wanted to also test `try_seek`, but it seems like I would need to have some threading code to call `next` on sink in another thread, which didn't look that good and resulted in a flaky test so only a 'unit test' in ``position.rs`. Resolves RustAudio#457 Closes RustAudio#510
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to obtain the current playing time and position when rodio plays music files
At present, I want to try to build a simple music playing software,
Music playing software needs the most basic
"Total duration" of music files
Current play position "Play time position"
Jump to the specified position "Time Position"
I don't know how to get the "play time position" at present
Thank you for your help
The text was updated successfully, but these errors were encountered: