-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
audioAll things related to audioAll things related to audioenhancementNew feature or requestNew feature or requestlambda-rsIssues pertaining to the core frameworkIssues pertaining to the core frameworklambda-rs-platformIssues pertaining to the dependency & platform wrappersIssues pertaining to the dependency & platform wrappers
Description
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
SoundBufferthrough anAudioDevice - 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
- 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
Metadata
Metadata
Assignees
Labels
audioAll things related to audioAll things related to audioenhancementNew feature or requestNew feature or requestlambda-rsIssues pertaining to the core frameworkIssues pertaining to the core frameworklambda-rs-platformIssues pertaining to the dependency & platform wrappersIssues pertaining to the dependency & platform wrappers