-
Notifications
You must be signed in to change notification settings - Fork 9
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 Seek for Gain #91
Comments
This is the heart of the problem, and is a design problem that I've wrestled with throughout oddio's development. To generate stereo audio, For immutable signals this is easy: we just skip the playback cursor around as needed with A possible solution is replacing
I have hesitated to pursue this further because the motivation is unclear to me. In oddio, it is trivial to apply dynamic gain after mixing, which is both more efficient and obviates the entire problem. Given this option I'm not sure why you'd want to dynamically adjust the gain of individual sounds. Game UIs tend to, at most, provide a handful of volume sliders, which might correspond to the output of a few discrete intermediate mixers. Baking additional features into |
I decided to optimize the As for the general idea of keeping Should I close this issue? |
You're right that there's significant complexity intrinsic to spatialization. That's why I'd like to keep complexity that isn't intrinsic to spatialization factored out as much as possible; it's liable to become a big enough monolith as it is. As outlined above there's a genuine hard design problem here, so we should keep it open unless it ends up mooted somehow. |
Thinking on this a bit more, the associated-cursor approach also isn't quite correct, because cursors at different points in time will observe changes in controls simultaneously, and therefore yield inconsistent results. This still avoids discontinuities, so maybe it's okay, but it's not ideal. Another approach might be to introduce an explicit notion of a state change at a particular time, and defer new state changes until any existing one has been passed by all live cursors. Feels kind of weird to try to abstract over ideas like cursor quantity when there's only one known use case... not sure how I feel about baking in knowledge of spatialization everywhere either, though. One other bit of food for thought is that reverb will mean buffering everything anyway, and spatial scenes will probably always want reverb, so bending over backwards to avoid buffering is perhaps completely futile in the long run. |
Currently Gain is non-seekable which requires using the
SpatialSceneControl::play_buffered
instead ofSpatialSceneControl::play
, which is both less ergonomic and slower (even with optimizations).OTOH, per-signal gain seems to be standard in many other libraries, e.g. kira, soloud, fyrox-sound.
We can either make Gain seekable or add
set_gain
(and related methods) toSpatialControl
. If we choose toimpl Seek for Gain
there is a question of whether we should rewind the gain when we seek back in time.The text was updated successfully, but these errors were encountered: