pub struct Gain { /* private fields */ }Expand description
Multiply every sample by a fixed gain.
The gain is a Q15 integer, so y = (x * g + 2^14) >> 15 (round half up)
then saturate. Unity is 32768 and is byte-identical passthrough. The
largest representable gain is about +30 dB (i32::MAX >> 15).
Implementations§
Trait Implementations§
impl Copy for Gain
Source§impl Element for Gain
impl Element for Gain
Source§fn output_format(&self, input: PcmFormat) -> Result<PcmFormat>
fn output_format(&self, input: PcmFormat) -> Result<PcmFormat>
The format this element emits for blocks in
input, or
Err(Unsupported) if it cannot take input at all.Source§fn process(&mut self, input: PcmBlock<'_>, out: &mut [u8]) -> Result<usize>
fn process(&mut self, input: PcmBlock<'_>, out: &mut [u8]) -> Result<usize>
Process one block into
out, returning the bytes written — a whole
number of output frames, possibly zero.impl Eq for Gain
impl StructuralPartialEq for Gain
Auto Trait Implementations§
impl Freeze for Gain
impl RefUnwindSafe for Gain
impl Send for Gain
impl Sync for Gain
impl Unpin for Gain
impl UnsafeUnpin for Gain
impl UnwindSafe for Gain
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