### 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 ```rust // 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 - [ ] Play a loaded sound buffer to completion - [ ] Pause and resume without audio artifacts - [ ] Stop playback and reset position - [ ] Loop sounds continuously when enabled - [ ] Example demonstrating play/pause/stop ### 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
Activity
feat(lambda-rs): Add sound playback devices (#184)