pub struct AudioBus { /* private fields */ }Expand description
A class that represents an audio bus.
Implementations§
Source§impl AudioBus
impl AudioBus
Sourcepub fn set_volume(&mut self, val: f32)
pub fn set_volume(&mut self, val: f32)
Sets The volume of the audio bus. The value is between 0.0 and 1.0.
Sourcepub fn get_volume(&self) -> f32
pub fn get_volume(&self) -> f32
Gets The volume of the audio bus. The value is between 0.0 and 1.0.
Sourcepub fn set_pan(&mut self, val: f32)
pub fn set_pan(&mut self, val: f32)
Sets The pan of the audio bus. The value is between -1.0 and 1.0.
Sourcepub fn set_play_speed(&mut self, val: f32)
pub fn set_play_speed(&mut self, val: f32)
Sets The play speed of the audio bus. The value 1.0 is the normal speed. 0.5 is half speed. 2.0 is double speed.
Sourcepub fn get_play_speed(&self) -> f32
pub fn get_play_speed(&self) -> f32
Gets The play speed of the audio bus. The value 1.0 is the normal speed. 0.5 is half speed. 2.0 is double speed.
Sourcepub fn fade_volume(&mut self, time: f64, to_volume: f32)
pub fn fade_volume(&mut self, time: f64, to_volume: f32)
Fades the volume of the audio bus to the given value over the given time.
§Arguments
time- The time to fade the volume.toVolume- The target volume.
Sourcepub fn fade_pan(&mut self, time: f64, to_pan: f32)
pub fn fade_pan(&mut self, time: f64, to_pan: f32)
Fades the pan of the audio bus to the given value over the given time.
§Arguments
time- The time to fade the pan.toPan- The target pan. The value is between -1.0 and 1.0.
Sourcepub fn fade_play_speed(&mut self, time: f64, to_play_speed: f32)
pub fn fade_play_speed(&mut self, time: f64, to_play_speed: f32)
Fades the play speed of the audio bus to the given value over the given time.
§Arguments
time- The time to fade the play speed.toPlaySpeed- The target play speed.
Sourcepub fn set_filter(&mut self, index: i32, name: &str)
pub fn set_filter(&mut self, index: i32, name: &str)
Sets the filter of the audio bus.
§Arguments
index- The index of the filter.name- The name of the filter.- “”: No filter.
- “BassBoost”: The bass boost filter.
- “BiquadResonant”: The biquad resonant filter.
- “DCRemoval”: The DC removal filter.
- “Echo”: The echo filter.
- “Eq”: The equalizer filter.
- “FFT”: The FFT filter.
- “Flanger”: The flanger filter.
- “FreeVerb”: The freeverb filter.
- “Lofi”: The lofi filter.
- “Robotize”: The robotize filter.
- “WaveShaper”: The wave shaper filter.
Sourcepub fn set_filter_parameter(&mut self, index: i32, attr_id: i32, value: f32)
pub fn set_filter_parameter(&mut self, index: i32, attr_id: i32, value: f32)
Sets the filter parameter of the audio bus.
§Arguments
index- The index of the filter.attrId- The attribute ID of the filter.value- The value of the filter parameter.- “BassBoost”: The bass boost filter.
- param0: WET, float, min: 0, max: 1
- param1: BOOST, float, min: 0, max: 10
- “BiquadResonant”: The biquad resonant filter.
- param0: WET, float, min: 0, max: 1
- param1: TYPE, int, values: 0 - LOWPASS, 1 - HIGHPASS, 2 - BANDPASS
- param2: FREQUENCY, float, min: 10, max: 8000
- param3: RESONANCE, float, min: 0.1, max: 20
- “DCRemoval”: The DC removal filter.
- param0: WET, float, min: 0, max: 1
- “Echo”: The echo filter.
- param0: WET, float, min: 0, max: 1
- param1: DELAY, float, min: 0, max: 1
- param2: DECAY, float, min: 0, max: 1
- param3: FILTER, float, min: 0, max: 1
- “Eq”: The equalizer filter.
- param0: WET, float, min: 0, max: 1
- param1: BAND0, float, min: 0, max: 4
- param2: BAND1, float, min: 0, max: 4
- param3: BAND2, float, min: 0, max: 4
- param4: BAND3, float, min: 0, max: 4
- param5: BAND4, float, min: 0, max: 4
- param6: BAND5, float, min: 0, max: 4
- param7: BAND6, float, min: 0, max: 4
- param8: BAND7, float, min: 0, max: 4
- “FFT”: The FFT filter.
- param0: WET, float, min: 0, max: 1
- “Flanger”: The flanger filter.
- param0: WET, float, min: 0, max: 1
- param1: DELAY, float, min: 0.001, max: 0.1
- param2: FREQ, float, min: 0.001, max: 100
- “FreeVerb”: The freeverb filter.
- param0: WET, float, min: 0, max: 1
- param1: FREEZE, float, min: 0, max: 1
- param2: ROOMSIZE, float, min: 0, max: 1
- param3: DAMP, float, min: 0, max: 1
- param4: WIDTH, float, min: 0, max: 1
- “Lofi”: The lofi filter.
- param0: WET, float, min: 0, max: 1
- param1: SAMPLE_RATE, float, min: 100, max: 22000
- param2: BITDEPTH, float, min: 0.5, max: 16
- “Robotize”: The robotize filter.
- param0: WET, float, min: 0, max: 1
- param1: FREQ, float, min: 0.1, max: 100
- param2: WAVE, float, min: 0, max: 6
- “WaveShaper”: The wave shaper filter.
- param0: WET, float, min: 0, max: 1
- param1: AMOUNT, float, min: -1, max: 1
- “BassBoost”: The bass boost filter.
Sourcepub fn get_filter_parameter(&mut self, index: i32, attr_id: i32) -> f32
pub fn get_filter_parameter(&mut self, index: i32, attr_id: i32) -> f32
Sourcepub fn fade_filter_parameter(
&mut self,
index: i32,
attr_id: i32,
to: f32,
time: f64,
)
pub fn fade_filter_parameter( &mut self, index: i32, attr_id: i32, to: f32, time: f64, )
Fades the filter parameter of the audio bus to the given value over the given time.
§Arguments
index- The index of the filter.attrId- The attribute ID of the filter.to- The target value of the filter parameter.time- The time to fade the filter parameter.