pub struct AuxInput<'a, S: Sample = f32> { /* private fields */ }Expand description
Immutable view of an auxiliary input bus.
Provides access to input channels for a single auxiliary bus
(typically sidechain). Created via AuxiliaryBuffers::sidechain()
or AuxiliaryBuffers::input().
§Type Parameter
S is the sample type, defaulting to f32.
§Example
ⓘ
if let Some(sidechain) = aux.sidechain() {
// Calculate RMS of sidechain for keying
let rms = sidechain.rms(0);
// Or iterate over all channels
for ch in sidechain.iter_channels() {
// Process channel...
}
}Implementations§
Source§impl<'a, S: Sample> AuxInput<'a, S>
impl<'a, S: Sample> AuxInput<'a, S>
Sourcepub fn num_samples(&self) -> usize
pub fn num_samples(&self) -> usize
Number of samples in each channel.
Sourcepub fn num_channels(&self) -> usize
pub fn num_channels(&self) -> usize
Number of channels in this bus.
Sourcepub fn channel(&self, index: usize) -> &[S]
pub fn channel(&self, index: usize) -> &[S]
Get a channel by index.
Returns an empty slice if the channel doesn’t exist.
Sourcepub fn iter_channels(&self) -> impl Iterator<Item = &[S]> + '_
pub fn iter_channels(&self) -> impl Iterator<Item = &[S]> + '_
Iterate over all channel slices.
Sourcepub fn rms(&self, channel: usize) -> S
pub fn rms(&self, channel: usize) -> S
Calculate the RMS (root mean square) level of a channel.
Returns zero if the channel doesn’t exist or is empty.
Auto Trait Implementations§
impl<'a, S> Freeze for AuxInput<'a, S>
impl<'a, S> RefUnwindSafe for AuxInput<'a, S>where
S: RefUnwindSafe,
impl<'a, S> Send for AuxInput<'a, S>
impl<'a, S> Sync for AuxInput<'a, S>
impl<'a, S> Unpin for AuxInput<'a, S>
impl<'a, S> UnwindSafe for AuxInput<'a, S>where
S: RefUnwindSafe,
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