pub enum ChannelLayout {
Mono,
Stereo,
Surround51,
Surround71,
AmbisonicFoa,
AmbisonicSoa,
AmbisonicToa,
Custom(usize),
}Expand description
Describes the channel layout for audio processing.
Standard layouts include mono, stereo, surround formats, and ambisonics.
Use Custom(n) for arbitrary channel counts.
Variants§
Mono
Single channel (mono).
Stereo
Two channels (left, right).
Surround51
5.1 surround: L, R, C, LFE, Ls, Rs (6 channels).
Surround71
7.1 surround: L, R, C, LFE, Ls, Rs, Lrs, Rrs (8 channels).
AmbisonicFoa
First-order ambisonics (4 channels: W, Y, Z, X).
AmbisonicSoa
Second-order ambisonics (9 channels).
AmbisonicToa
Third-order ambisonics (16 channels).
Custom(usize)
Custom channel count for non-standard configurations.
Implementations§
Source§impl ChannelLayout
impl ChannelLayout
Sourcepub const fn channel_count(&self) -> usize
pub const fn channel_count(&self) -> usize
Returns the number of channels for this layout.
Sourcepub const fn is_ambisonic(&self) -> bool
pub const fn is_ambisonic(&self) -> bool
Returns true if this is an ambisonic layout.
Sourcepub const fn ambisonic_order(&self) -> Option<usize>
pub const fn ambisonic_order(&self) -> Option<usize>
Returns the ambisonic order if this is an ambisonic layout.
Returns None for non-ambisonic layouts.
Sourcepub const fn from_ambisonic_order(order: usize) -> Option<Self>
pub const fn from_ambisonic_order(order: usize) -> Option<Self>
Creates an ambisonic layout from an order (1-3).
Returns None if the order is out of range.
Sourcepub const fn ambisonic_channel_count(order: usize) -> usize
pub const fn ambisonic_channel_count(order: usize) -> usize
Returns the number of channels for a given ambisonic order.
Formula: (order + 1)^2
Trait Implementations§
Source§impl Clone for ChannelLayout
impl Clone for ChannelLayout
Source§fn clone(&self) -> ChannelLayout
fn clone(&self) -> ChannelLayout
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more