Skip to content
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

Few questions regarding ogg playback #395

Open
kaphula opened this issue Sep 25, 2021 · 1 comment
Open

Few questions regarding ogg playback #395

kaphula opened this issue Sep 25, 2021 · 1 comment

Comments

@kaphula
Copy link

kaphula commented Sep 25, 2021

Hey,

At first glance I could not figure if this is possible so I decided to ask here. Does rodio support simple calls for achieving these things:

  • Start playing ogg file at a specific point in seconds
  • Get the current position of the ogg file that is playing in seconds (real-time)

Thanks!

@VanillaBrooks
Copy link

Start playing ogg file at a specific point in seconds

The source trait allows this https://docs.rs/rodio/0.14.0/rodio/source/trait.Source.html#method.skip_duration but its not ideal, see #176

Get the current position of the ogg file that is playing in seconds (real-time)

Not that I know of, but it can probably be done by creating an std::time::Instant when you play the file and manually adding on any skipped Durations. You can then call .elapsed() on the original Instant to get current position in seconds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants