pub struct GainControl<Flt> { /* private fields */ }
Expand description

Gain control

Note that while this block works with generic Floats, the gain value passed to GainControl::new and GainControl::set is of type f64.

The gain value is multiplied with each sample such that a value of 0.5 corresponds to −0.6 dB.

Example

use radiorust::blocks::transform::GainControl;
let attenuate_6db = GainControl::<f32>::new(0.5f64);

Implementations

Creates a block which multiplies each sample with the given gain

Get current gain

Set gain

Trait Implementations

Obtain reference to ReceiverConnector
Connect Consumer to Producer
Disconnect Consumer from any connected Producer if connected
👎Deprecated since 0.2.0: method has been renamed to feed_from
Connect Consumer to Producer
👎Deprecated since 0.2.0: method has been renamed to feed_from_none
Disconnect Consumer from any connected Producer if connected
Obtain reference to SenderConnector
Connect Producer to Consumer
👎Deprecated since 0.2.0: method has been renamed to feed_into
Connect Producer to Consumer

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.