You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add volume (gain) and pitch (playback speed) controls to sound instances for
basic audio manipulation.
Current State
Requires basic sound playback to be implemented first. No audio property
controls exist.
Scope
Goals:
Set volume/gain per sound instance (0.0 to 1.0+)
Set pitch/playback speed per sound instance
Support global/master volume
Non-Goals:
Audio effects (reverb, echo)
Per-channel volume
Volume fading/transitions
Proposed API
implSoundInstance{/// Set volume where 1.0 is normal, 0.0 is silent, >1.0 amplifies.pubfnset_volume(&mutself,volume:f32);pubfnvolume(&self) -> f32;/// Set pitch where 1.0 is normal, 0.5 is half speed, 2.0 is double.pubfnset_pitch(&mutself,pitch:f32);pubfnpitch(&self) -> f32;}implAudioContext{pubfnset_master_volume(&mutself,volume:f32);pubfnmaster_volume(&self) -> f32;}
Acceptance Criteria
Volume 0.0 produces silence
Volume 1.0 plays at original level
Volume >1.0 amplifies (with clipping awareness)
Pitch 1.0 plays at original speed
Pitch changes affect both speed and frequency
Master volume affects all playing sounds
Affected Crates
lambda-rs, lambda-rs-platform
Notes
Pitch shifting via resampling is acceptable for v1
Activity
feat(lambda-rs): Pitch and Volume control (#186)