euv-core 0.52.0

Core cross-platform runtime for euv featuring arena-based fine-grained reactivity, deterministic layout, flat scene graph, multi-mode rendering, and direct OS platform adapters.
Documentation
/// 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(crate) const MIN_AUDIO_SAMPLE_RATE_HZ: u32 = 8_000;

/// Maximum supported PCM sample rate in Hertz.
pub(crate) const MAX_AUDIO_SAMPLE_RATE_HZ: u32 = 192_000;

/// Soft-knee limiter onset threshold keeping stereo PCM smooth below full-scale clipping.
pub(crate) const AUDIO_SOFT_KNEE_THRESHOLD: f32 = 0.85;

/// Denormal flush epsilon zeroing near-silent floating-point tails.
pub(crate) const AUDIO_DENORMAL_EPSILON: f32 = 1e-12;

/// Diagnostic error message when no native OS audio output driver is available on the current target.
pub(crate) const AUDIO_ERR_DRIVER_UNAVAILABLE: &str = "native audio output driver unavailable";

/// Diagnostic error message when CoreAudio AUHAL component lookup or initialization fails.
pub(crate) const AUDIO_ERR_COREAUDIO_INIT: &str = "CoreAudio AUHAL initialization failed";

/// Diagnostic error message when CoreAudio `AudioOutputUnitStart` fails.
pub(crate) const AUDIO_ERR_COREAUDIO_START: &str = "CoreAudio AUHAL start failed";

/// CoreAudio FourCC for linear PCM format (`'lpcm'`).
#[cfg(target_os = "macos")]
pub(crate) const COREAUDIO_FORMAT_LINEAR_PCM: u32 = 0x6C70_636D;

/// CoreAudio format flag denoting 32-bit floating-point PCM samples.
#[cfg(target_os = "macos")]
pub(crate) const COREAUDIO_FLAG_IS_FLOAT: u32 = 1 << 0;

/// CoreAudio format flag denoting tightly packed interleaved samples.
#[cfg(target_os = "macos")]
pub(crate) const COREAUDIO_FLAG_IS_PACKED: u32 = 1 << 3;

/// CoreAudio component type `'auou'` (`kAudioUnitType_Output`).
#[cfg(target_os = "macos")]
pub(crate) const COREAUDIO_UNIT_TYPE_OUTPUT: u32 = 0x6175_6F75;

/// CoreAudio component subtype `'def '` (`kAudioUnitSubType_DefaultOutput`).
#[cfg(target_os = "macos")]
pub(crate) const COREAUDIO_SUBTYPE_DEFAULT_OUTPUT: u32 = 0x6465_6620;

/// CoreAudio Apple manufacturer identifier `'appl'`.
#[cfg(target_os = "macos")]
pub(crate) const COREAUDIO_MANUFACTURER_APPLE: u32 = 0x6170_706C;

/// CoreAudio property identifier `kAudioUnitProperty_StreamFormat` (`8`).
#[cfg(target_os = "macos")]
pub(crate) const COREAUDIO_PROP_STREAM_FORMAT: u32 = 8;

/// CoreAudio property identifier `kAudioUnitProperty_SetRenderCallback` (`23`).
#[cfg(target_os = "macos")]
pub(crate) const COREAUDIO_PROP_SET_RENDER_CALLBACK: u32 = 23;

/// CoreAudio input scope identifier `kAudioUnitScope_Input` (`1`).
#[cfg(target_os = "macos")]
pub(crate) const COREAUDIO_SCOPE_INPUT: u32 = 1;

/// CoreAudio output bus index `0`.
#[cfg(target_os = "macos")]
pub(crate) const COREAUDIO_BUS_OUTPUT: u32 = 0;