RustAudio / rodio

Rust audio playback library
Apache License 2.0
1.65k stars 214 forks source link

Is a scheduled-playback-feature and retrieving playback position planned? #192

Open kerskuchen opened 5 years ago

kerskuchen commented 5 years ago

It would be very useful (i.e. for rhythm games and effects like mickey-mousing) to play sounds starting at a certain sample-index and also to retrieve the index of the last sample that was committed to cpal.

An example of an API that does this would be Unity3D's AudioSource.PlaySheduled function and its AudioSettings.dspTime

Combining those two APIs make the gameplay in the following 1 minute video possible.

Building this from scratch over cpal would be possible but tedious and would duplicate the existing functionality of rodio in every case except for the above API additions. So I thought I just ask if are any plans to do this already :)

PaddyCo commented 5 years ago

I really needed a way to retrieve the playback position (working on a rhythm game), so I tried my hand at implementing it as a filter: https://github.com/PaddyCo/rodio/tree/elapsed

I'm gonna test it out more thoroughly before I submit a pull request, but it should be accurate enough for most use-cases

yong-jie commented 5 years ago

@PaddyCo Any plans to do a PR for this? I think this would be a great addition that could benefit those who are requesting for the feature!

nickmonad commented 4 years ago

@PaddyCo +1 for a PR for the elapsed feature. I used your branch in a private project and it worked great. Would love to see this make it into master.

PaddyCo commented 4 years ago

Oh sorry I totally forgot about this, I'm gonna try and find some time this weekend and do some clean-up if necessary and then I'll open a PR 😅

TonalidadeHidrica commented 3 years ago

Hi, I really want want the "playback position" feature for my project and waiting for the pull request to be merged. By the way, are there any info about scheduled playback yet?

temportalflux commented 1 year ago

Has there been any movement on this, or has this request been discarded?