#[repr(C, align(64))]pub struct Q4AuHeaderV3 {Show 17 fields
pub magic: u32,
pub version: u16,
pub transform_kind: u16,
pub bin_count: u32,
pub frame_count: u32,
pub sample_rate: u32,
pub ambisonic_order: u8,
pub channel_normalization: u8,
pub sofa_fir_taps: u16,
pub sofa_direction_count: u32,
pub sofa_block_offset: u32,
pub mel_count: u16,
pub mfcc_count: u16,
pub rt60_bands_sec: [f32; 3],
pub portal_coupling_did_hash: u64,
pub portal_transmission_gain: f32,
pub header_crc32c: u32,
}Expand description
64-byte cache-line-aligned spatial acoustic container header.
Fields§
§magic: u32Format magic “Q4AU” (SPECTRAL_SIDECAR_MAGIC = 0x5134_4155).
version: u16Format version (Q4AU_VERSION_V3 = 3).
transform_kind: u16Transform kind (0 = STFT, 1 = CQT, 2 = HOA_STFT).
bin_count: u32Frequency bins per frame.
frame_count: u32Number of frames in the raster.
sample_rate: u32Source sample rate (e.g. 48_000).
ambisonic_order: u8Ambisonic order L in 0..=3 ((L+1)^2 channels).
channel_normalization: u8Channel normalization (0 = SN3D_ACN, 1 = N3D_ACN).
sofa_fir_taps: u16Number of FIR taps per ear in SOFA table (e.g. 64).
sofa_direction_count: u32Number of discrete directions in the SOFA table block.
sofa_block_offset: u32Absolute byte offset from start of file to SOFA HRIR table block (0 if none).
mel_count: u16Number of mel frequency bands (0 if none).
mfcc_count: u16Number of MFCC coefficients (0 if none).
rt60_bands_sec: [f32; 3]RT60 reverberation decay times in seconds for low / mid / high octave bands.
portal_coupling_did_hash: u64DID hash of linked acoustic portal boundary for diffraction/transmission.
portal_transmission_gain: f32Portal transmission scalar gain (0.0 .. 1.0).
header_crc32c: u32Whole-header CRC-32C computed over the first 60 bytes.
Implementations§
Source§impl Q4AuHeaderV3
impl Q4AuHeaderV3
Sourcepub const fn empty() -> Self
pub const fn empty() -> Self
Empty header initialized with magic, version 3, and default 48kHz.
Sourcepub fn compute_crc32c(&self) -> u32
pub fn compute_crc32c(&self) -> u32
Compute CRC-32C over the first 60 bytes of this header.
Sourcepub fn update_crc(&mut self)
pub fn update_crc(&mut self)
Update header_crc32c with the computed CRC-32C of this header.
Sourcepub fn validate(&self) -> bool
pub fn validate(&self) -> bool
True when magic, version, order, geometry and CRC-32C are valid.
Sourcepub fn hoa_channel_count(&self) -> usize
pub fn hoa_channel_count(&self) -> usize
Channel count corresponding to ambisonic_order: (order + 1)^2.
Sourcepub fn payload_bytes(&self) -> usize
pub fn payload_bytes(&self) -> usize
Byte size of the HOA spectral raster payload.
Sourcepub fn sofa_bytes(&self) -> usize
pub fn sofa_bytes(&self) -> usize
Byte size of the embedded SOFA HRIR table.
Trait Implementations§
Source§impl Clone for Q4AuHeaderV3
impl Clone for Q4AuHeaderV3
impl Copy for Q4AuHeaderV3
Source§impl Debug for Q4AuHeaderV3
impl Debug for Q4AuHeaderV3
Source§impl PartialEq for Q4AuHeaderV3
impl PartialEq for Q4AuHeaderV3
impl Pod for Q4AuHeaderV3
impl StructuralPartialEq for Q4AuHeaderV3
Auto Trait Implementations§
impl Freeze for Q4AuHeaderV3
impl RefUnwindSafe for Q4AuHeaderV3
impl Send for Q4AuHeaderV3
impl Sync for Q4AuHeaderV3
impl Unpin for Q4AuHeaderV3
impl UnsafeUnpin for Q4AuHeaderV3
impl UnwindSafe for Q4AuHeaderV3
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<T> AnyBitPattern for Twhere
T: Pod,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
impl<T> Interleave for Twhere
T: Pod,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more