-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Add support for seeking audio. #9076
Comments
Bevy uses Symphonia indirectly, and Rodio has not exposed API for seeking. Please see: Currently Bevy is blocked on this. |
(Update) Rodio feature Audio Seek awaiting review and pull request. See: RustAudio/rodio#513 |
has been merged 🥳 l will cut a release in a few days but you should be able to start building a PR on top of it now. |
@harudagondi Since we are no longer waiting for rodio, can the blocked label be removed? |
I've removed the blocked label, so anybody feel free to tackle this! It should be noted that work on this will soon be superceeded by the ongoing work to replace rodio with kira, so it has a limited shelf life; however contributions are still welcome. |
Out of interest, (I now help maintain rodio) could you point me at the reasons why bevy is switching to kira (kira looks great btw)? That could help plot a course for rodio's development. |
Kira specifically has some nice-to-have features that make it more attractive to base Bevy's audio engine around:
One downside of Kira at the moment is the lack of runtime changes to the track effects rack or the output of audio sources into the mixer, which is a bit of a bummer, but I'm more confident with the architecture of Kira that it can eventually be added. Sorry it's bleak, and as a maintainer it's not the easiest to read, but that's my feelings and the reasoning behind the change. |
@SolarLiner Thanks for you for taking the time to write that very clear explanation. I had a look around the Kira source and it looks great. I'm gonna contact its maintainer and discuss kira's scope. If everything rodio provides and my future plans for it fit into kira better then it could be better to move my focus there. It makes little senses to split the rather small rust audio contributions between two similar crates. |
Rodio has existed for about 9 years. When it was written there where no audio libraries for rust. Therefore rodio can do everything but not everything perfectly. A lot has changed since then and new libraries have popped up for specific goals such as game-audio (kira) & digital signal processing. This is a good thing in my opinion, when developing a library you have to make choices and they exclude some use cases. When I started maintaining rodio I had a short exchange with the bevy devs (1/3 of rodio downloads are from bevy) about their planned move from rodio to kira. Note the have not migrated to kira as of this writing. See bevyengine/bevy#9076 (comment) I also had a short exchange with the kira dev to see if kira could support all audio usecases, that seems to not be the case. See: tesselode/kira#87 Over the past few weeks we have collected the use-cases for rodio, see issue #626. After talking to the bevy dev and kira dev I made some goals for rodio in my head. Now that rodio is (very) actively maintained we need to write those down and discuss them. That way we do not make contradicting decisions in rodio. Please let me know what you think.
What problem does this solve or what need does it fill?
Seeking audio is practically a must have for any rhythm game that wants to have a beatmap editor.
In the song selection screen of a rhythm game, it is also common to play a preview of the song you have selected. Usually this preview starts somewhere in the song, and not from the beginning.
What solution would you like?
If I'm not mistaken bevy_audio uses Symphonia and Rodio. Symphonia already supports seeking, exposing this would be enough for my use case. Additionally, it would be nice to be able to get total playtime of the audio file since that would make it easier to make decisions about where to start previewing a file.
What alternative(s) have you considered?
Setting the playback speed very high to advance to the point you want to seek to in a single frame, but that's not very elegant. bevy_kira_audio is the only reasonable alternative right now as far as I know.
The text was updated successfully, but these errors were encountered: