rodio icon indicating copy to clipboard operation
rodio copied to clipboard

Few questions regarding ogg playback

Open kaphula opened this issue 4 years ago • 1 comments

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!

kaphula avatar Sep 25 '21 17:09 kaphula

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.

VanillaBrooks avatar Nov 11 '21 21:11 VanillaBrooks