pub struct MixerNode {
pub clipping: bool,
/* private fields */
}Expand description
A node that combines multiple audio signals into a single output.
It applies a gain factor to the mixed signal and performs hard clipping to ensure the output remains within the [-1.0, 1.0] range.
Supports dynamic gain updates via ControlMessage::SetParameter.
§Example
use rust_audio_api::nodes::{MixerNode, NodeType};
use rust_audio_api::{AudioContext, NodeParameter};
let mut ctx = AudioContext::new().unwrap();
let mut mixer_id = None;
let dest_id = ctx.build_graph(|builder| {
let mixer = builder.add_node(NodeType::Mixer(MixerNode::with_gain(1.0)));
mixer_id = Some(mixer);
mixer
});
// Dynamically reduce the master mix volume
ctx.control_sender().send(
rust_audio_api::graph::ControlMessage::SetParameter(
mixer_id.unwrap(),
NodeParameter::Gain(0.5)
)
).unwrap();Fields§
§clipping: boolImplementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MixerNode
impl RefUnwindSafe for MixerNode
impl Send for MixerNode
impl Sync for MixerNode
impl Unpin for MixerNode
impl UnsafeUnpin for MixerNode
impl UnwindSafe for MixerNode
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