bevy_kira_audio icon indicating copy to clipboard operation
bevy_kira_audio copied to clipboard

Add Tween Options

Open zicklag opened this issue 2 years ago • 3 comments

Hey there!

Would you be open to a pull request that adds versions of the play, stop, etc. functions that additionally take the Tween parameter present in kira?

I was using my own wrapper around kira for Bevy, but would like to switch to this one and that looks like it's the only feature I'm missing.

I think we could re-export Tween from kira, but maybe rename it to AudioTween, just to avoid confusion with any other Bevy tweening plugins or something like that.

zicklag avatar Jun 25 '22 21:06 zicklag

I definitely want to support tweening and any help would be appreciated.

Maybe we can avoid duplicated methods and do something similar to entity commands? I am thinking of user code along the lines of

audio.play(handle).tween(my_tween);

NiklasEi avatar Jun 25 '22 21:06 NiklasEi

That is a great idea that I hadn't thought of. That should be simple.

I think I'm going to need this soon and it should be simple to implement, so I'll probably have a PR for you in not too long.

While we're at it, do you think it makes sense to have a way to stop a specific sound, instead of stopping everything in a channel? I'm not sure if I'll need it, but that was another thing I had in my old audio plugin.

zicklag avatar Jun 25 '22 22:06 zicklag

Yes, stop and other controls are planned on single instance handles (#53 ). If you have time for it, feel free to implement any of the controls.

NiklasEi avatar Jun 26 '22 08:06 NiklasEi

I went ahead and implemented the discussed changes. I couldn't find a fork with commits from you, so I hope we didn't duplicate any work now.

NiklasEi avatar Aug 10 '22 15:08 NiklasEi

Oh, no, I got caught up with other concerns and hadn't gotten to this yet. Thanks for adding the feature!

zicklag avatar Aug 10 '22 16:08 zicklag