Overview
Add the ability to play loaded sound buffers through the audio device with
basic transport controls (play, pause, stop).
Current State
Audio device initialization and sound loading must be implemented first
(see related issues). No playback capability exists.
Scope
Goals:
- Play a
SoundBuffer through an AudioDevice
- Pause and resume playback
- Stop playback
- Query playback state (playing, paused, stopped)
- Support looping playback
Non-Goals:
- Volume control
- Pitch/speed control
- Spatial audio
- Multiple simultaneous sounds
Proposed API
// crates/lambda-rs/src/audio/mod.rs
pub struct SoundInstance {
// internal handle
}
impl SoundInstance {
pub fn play(&mut self);
pub fn pause(&mut self);
pub fn stop(&mut self);
pub fn set_looping(&mut self, looping: bool);
pub fn is_playing(&self) -> bool;
pub fn is_paused(&self) -> bool;
}
// On AudioContext or similar
pub fn play_sound(&mut self, buffer: &SoundBuffer) -> SoundInstance;
Acceptance Criteria
Affected Crates
lambda-rs, lambda-rs-platform
Notes
- Sound instances should be lightweight handles
- Consider ring buffer for audio thread communication
- Audio callback runs on separate thread; avoid blocking
Overview
Add the ability to play loaded sound buffers through the audio device with
basic transport controls (play, pause, stop).
Current State
Audio device initialization and sound loading must be implemented first
(see related issues). No playback capability exists.
Scope
Goals:
SoundBufferthrough anAudioDeviceNon-Goals:
Proposed API
Acceptance Criteria
Affected Crates
lambda-rs, lambda-rs-platform
Notes