pub struct BinauralDecoderBlock<S>where
S: Sample,{ /* private fields */ }Expand description
Decodes multi-channel audio to stereo for headphone listening.
Supports ambisonic B-format (1st, 2nd, 3rd order) and can be configured to use either lightweight matrix decoding or full HRTF convolution.
§Supported Input Formats
- Ambisonics: FOA (4 ch), SOA (9 ch), TOA (16 ch)
- Surround: 5.1 (6 ch), 7.1 (8 ch)
§Output
Always stereo (2 channels): Left, Right
§Example
ⓘ
use bbx_dsp::blocks::effectors::binaural_decoder::{BinauralDecoderBlock, BinauralStrategy};
// Create HRTF decoder (default)
let hrtf_decoder = BinauralDecoderBlock::<f32>::new(1);
// Create lightweight matrix decoder
let matrix_decoder = BinauralDecoderBlock::<f32>::with_strategy(1, BinauralStrategy::Matrix);Implementations§
Source§impl<S> BinauralDecoderBlock<S>where
S: Sample,
impl<S> BinauralDecoderBlock<S>where
S: Sample,
Sourcepub fn new(order: usize) -> BinauralDecoderBlock<S>
pub fn new(order: usize) -> BinauralDecoderBlock<S>
Sourcepub fn with_strategy(
order: usize,
strategy: BinauralStrategy,
) -> BinauralDecoderBlock<S>
pub fn with_strategy( order: usize, strategy: BinauralStrategy, ) -> BinauralDecoderBlock<S>
Sourcepub fn new_surround(
channel_count: usize,
strategy: BinauralStrategy,
) -> BinauralDecoderBlock<S>
pub fn new_surround( channel_count: usize, strategy: BinauralStrategy, ) -> BinauralDecoderBlock<S>
Sourcepub fn order(&self) -> usize
pub fn order(&self) -> usize
Returns the ambisonic order (for ambisonic inputs).
Returns 0 for surround inputs.
Sourcepub fn strategy(&self) -> BinauralStrategy
pub fn strategy(&self) -> BinauralStrategy
Returns the current decoding strategy.
Trait Implementations§
Source§impl<S> Block<S> for BinauralDecoderBlock<S>where
S: Sample,
impl<S> Block<S> for BinauralDecoderBlock<S>where
S: Sample,
Source§fn process(
&mut self,
inputs: &[&[S]],
outputs: &mut [&mut [S]],
_modulation_values: &[S],
_context: &DspContext,
)
fn process( &mut self, inputs: &[&[S]], outputs: &mut [&mut [S]], _modulation_values: &[S], _context: &DspContext, )
Process audio through this block. Read more
Source§fn input_count(&self) -> usize
fn input_count(&self) -> usize
Returns the number of input ports this block accepts.
Source§fn output_count(&self) -> usize
fn output_count(&self) -> usize
Returns the number of output ports this block produces.
Source§fn modulation_outputs(&self) -> &[ModulationOutput]
fn modulation_outputs(&self) -> &[ModulationOutput]
Returns the modulation outputs this block provides. Read more
Source§fn channel_config(&self) -> ChannelConfig
fn channel_config(&self) -> ChannelConfig
Returns how this block handles multi-channel audio. Read more
Auto Trait Implementations§
impl<S> Freeze for BinauralDecoderBlock<S>
impl<S> RefUnwindSafe for BinauralDecoderBlock<S>where
S: RefUnwindSafe,
impl<S> Send for BinauralDecoderBlock<S>
impl<S> Sync for BinauralDecoderBlock<S>
impl<S> Unpin for BinauralDecoderBlock<S>where
S: Unpin,
impl<S> UnwindSafe for BinauralDecoderBlock<S>where
S: UnwindSafe,
Blanket Implementations§
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
Mutably borrows from an owned value. Read more