tesselode / kira

Library for expressive game audio.
https://crates.io/crates/kira
Apache License 2.0
837 stars 42 forks source link

Feature Request: Unified API for working with Handles #35

Closed The-Minecraft-Scientist closed 1 year ago

The-Minecraft-Scientist commented 1 year ago

Currently, static and streaming SoundData::Handles have no unified API (e.g. if you are working with both types in the same context you must handle each as a seperate case. It would be really nice if there was a seperate SoundHandle trait that both static and streaming sound handles implemented to that contained the methods they have in common.

(if something like this already exists, please point me towards it, I'm pretty new to Rust :))

tesselode commented 1 year ago

That would be nice; the problem is the Sound trait can be implemented by anyone, and there's no guarantee that those implementations will have any given features, like pausing, setting the volume, etc. It would be possible to make a handle just for static and streaming sound data, but for now I'd rather err on the side of Kira not including things that the user could relatively easily make themselves.