-
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 framework
Description
Overview
Create a high-level AudioContext that integrates with the Lambda runtime,
providing a unified interface for all audio operations and automatic resource
management.
Current State
N/A
Scope
Goals:
AudioContextBuilderfollowing existing patterns- Automatic device initialization
- Resource handle management (similar to RenderContext)
- Integration with component lifecycle
- Thread-safe audio command submission
Non-Goals:
- Component-specific audio helpers
- Audio asset integration
Proposed API
// crates/lambda-rs/src/audio/mod.rs
pub struct AudioContext {
// device, mixer, resources
}
pub struct AudioContextBuilder {
label: Option<String>,
max_voices: usize,
}
impl AudioContextBuilder {
pub fn new() -> Self;
pub fn with_label(self, label: &str) -> Self;
pub fn with_max_voices(self, count: usize) -> Self;
pub fn build(self) -> Result<AudioContext, AudioError>;
}
impl AudioContext {
pub fn load_sound(&mut self, path: &Path) -> Result<SoundId, AudioError>;
pub fn play(&mut self, sound: SoundId) -> SoundInstance;
pub fn set_master_volume(&mut self, volume: f32);
// ...
}Acceptance Criteria
- AudioContext builds successfully with defaults
- Sounds loaded via context are managed (no manual cleanup)
- Context can be passed to components like RenderContext
- Graceful shutdown releases audio resources
- Example showing AudioContext with ApplicationRuntime
Affected Crates
lambda-rs
Notes
- Consider making AudioContext optional (not all apps need audio)
- May require runtime builder modification to include audio
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 framework