feat(audio): add 32-voice PCM mixing and native music sequencing
Add self-contained SoundBanks and MusicBanks with per-sample PCM16 and IMA ADPCM storage, materialized to resident PCM16. Integrate instrument envelopes, automation, shared DSP and host lifecycle controls while preserving staged real-time execution.
This commit is contained in:
@@ -20,6 +20,20 @@ pub enum AudioOpStatus {
|
||||
CommandLimit = 7,
|
||||
}
|
||||
|
||||
/// High-level commands are staged with the ordinary frame/lifecycle batch.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum AudioControl {
|
||||
GroupVolume { group: usize, gain: u8 },
|
||||
MusicStop { group: usize },
|
||||
MusicPause { group: usize, paused: bool },
|
||||
MusicVolume { group: usize, gain: u8 },
|
||||
MusicFade { group: usize, gain: u8, frames: u32, smooth: bool },
|
||||
Crossfade { source: usize, target: usize, frames: u32, smooth: bool },
|
||||
BusVolume { bus: usize, gain: u8 },
|
||||
Effect { group: usize, cutoff_hz: u32, delay_frames: u32, feedback: f32, wet: f32, dry: f32 },
|
||||
SfxSend { voice: usize, gain: u8 },
|
||||
}
|
||||
|
||||
pub trait AudioBridge {
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
fn play(
|
||||
@@ -44,6 +58,8 @@ pub trait AudioBridge {
|
||||
priority: u8,
|
||||
loop_mode: LoopMode,
|
||||
) -> AudioOpStatus;
|
||||
fn music_play(&mut self, group: usize, bank: usize, looping: bool) -> AudioOpStatus;
|
||||
fn control(&mut self, control: AudioControl) -> AudioOpStatus;
|
||||
fn stop(&mut self, voice_id: usize) -> AudioOpStatus;
|
||||
fn set_volume(&mut self, voice_id: usize, volume: u8) -> AudioOpStatus;
|
||||
fn set_pan(&mut self, voice_id: usize, pan: u8) -> AudioOpStatus;
|
||||
|
||||
Reference in New Issue
Block a user