1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/// Default stereo PCM output sample rate in Hertz (`48 kHz`).
pub const DEFAULT_AUDIO_SAMPLE_RATE_HZ: u32 = 48_000;
/// Default output channel count (`2` = stereo interleaved L/R).
pub const DEFAULT_AUDIO_CHANNELS: u16 = 2;
/// Default stereo frame capacity of the PCM output ring buffer (`~85 ms` at `48 kHz`).
pub const DEFAULT_AUDIO_RING_FRAMES: usize = 4_096;
/// Default maximum simultaneously active synthesized voices before voice stealing triggers.
pub const DEFAULT_AUDIO_MAX_VOICES: usize = 32;
/// Minimum supported PCM sample rate in Hertz.
pub const MIN_AUDIO_SAMPLE_RATE_HZ: u32 = 8_000;
/// Maximum supported PCM sample rate in Hertz.
pub const MAX_AUDIO_SAMPLE_RATE_HZ: u32 = 192_000;
/// Soft-knee limiter onset threshold keeping stereo PCM smooth below full-scale clipping.
pub const AUDIO_SOFT_KNEE_THRESHOLD: f32 = 0.85;
/// Denormal flush epsilon zeroing near-silent floating-point tails.
pub const AUDIO_DENORMAL_EPSILON: f32 = 1e-12;
/// Diagnostic error message when no native OS audio output driver is available on the current target.
pub const AUDIO_ERR_DRIVER_UNAVAILABLE: &str = "native audio output driver unavailable";
/// Diagnostic error message when CoreAudio AUHAL component lookup or initialization fails.
pub const AUDIO_ERR_COREAUDIO_INIT: &str = "CoreAudio AUHAL initialization failed";
/// Diagnostic error message when CoreAudio `AudioOutputUnitStart` fails.
pub const AUDIO_ERR_COREAUDIO_START: &str = "CoreAudio AUHAL start failed";
/// CoreAudio FourCC for linear PCM format (`'lpcm'`).
pub const COREAUDIO_FORMAT_LINEAR_PCM: u32 = 0x6C70_636D;
/// CoreAudio format flag denoting 32-bit floating-point PCM samples.
pub const COREAUDIO_FLAG_IS_FLOAT: u32 = 1 << 0;
/// CoreAudio format flag denoting tightly packed interleaved samples.
pub const COREAUDIO_FLAG_IS_PACKED: u32 = 1 << 3;
/// CoreAudio component type `'auou'` (`kAudioUnitType_Output`).
pub const COREAUDIO_UNIT_TYPE_OUTPUT: u32 = 0x6175_6F75;
/// CoreAudio component subtype `'def '` (`kAudioUnitSubType_DefaultOutput`).
pub const COREAUDIO_SUBTYPE_DEFAULT_OUTPUT: u32 = 0x6465_6620;
/// CoreAudio Apple manufacturer identifier `'appl'`.
pub const COREAUDIO_MANUFACTURER_APPLE: u32 = 0x6170_706C;
/// CoreAudio property identifier `kAudioUnitProperty_StreamFormat` (`8`).
pub const COREAUDIO_PROP_STREAM_FORMAT: u32 = 8;
/// CoreAudio property identifier `kAudioUnitProperty_SetRenderCallback` (`23`).
pub const COREAUDIO_PROP_SET_RENDER_CALLBACK: u32 = 23;
/// CoreAudio input scope identifier `kAudioUnitScope_Input` (`1`).
pub const COREAUDIO_SCOPE_INPUT: u32 = 1;
/// CoreAudio output bus index `0`.
pub const COREAUDIO_BUS_OUTPUT: u32 = 0;