Struct servo_media_audio::panner_node::PannerNode
source · pub(crate) struct PannerNode {Show 16 fields
channel_info: ChannelInfo,
panning_model: PanningModel,
distance_model: DistanceModel,
position_x: Param,
position_y: Param,
position_z: Param,
orientation_x: Param,
orientation_y: Param,
orientation_z: Param,
ref_distance: f64,
max_distance: f64,
rolloff_factor: f64,
cone_inner_angle: f64,
cone_outer_angle: f64,
cone_outer_gain: f64,
listener_data: Option<Block>,
}
Fields§
§channel_info: ChannelInfo
§panning_model: PanningModel
§distance_model: DistanceModel
§position_x: Param
§position_y: Param
§position_z: Param
§orientation_x: Param
§orientation_y: Param
§orientation_z: Param
§ref_distance: f64
§max_distance: f64
§rolloff_factor: f64
§cone_inner_angle: f64
§cone_outer_angle: f64
§cone_outer_gain: f64
§listener_data: Option<Block>
Implementations§
source§impl PannerNode
impl PannerNode
pub fn new(options: PannerNodeOptions, channel_info: ChannelInfo) -> Self
pub fn update_parameters(&mut self, info: &BlockInfo, tick: Tick) -> bool
sourcefn azimuth_elevation_distance(
&self,
listener: (Vector3D<f32>, Vector3D<f32>, Vector3D<f32>),
) -> (f32, f32, f64)
fn azimuth_elevation_distance( &self, listener: (Vector3D<f32>, Vector3D<f32>, Vector3D<f32>), ) -> (f32, f32, f64)
Computes azimuth, elevation, and distance of source with respect to a given AudioListener’s position, forward, and up vectors in degrees
https://webaudio.github.io/web-audio-api/#azimuth-elevation https://webaudio.github.io/web-audio-api/#Spatialization-distance-effects
sourcefn cone_gain(
&self,
listener: (Vector3D<f32>, Vector3D<f32>, Vector3D<f32>),
) -> f64
fn cone_gain( &self, listener: (Vector3D<f32>, Vector3D<f32>, Vector3D<f32>), ) -> f64
https://webaudio.github.io/web-audio-api/#Spatialization-sound-cones
fn linear_distance(&self, distance: f64, rolloff_factor: f64) -> f64
fn inverse_distance(&self, distance: f64, rolloff_factor: f64) -> f64
fn exponential_distance(&self, distance: f64, rolloff_factor: f64) -> f64
fn distance_gain_fn(&self) -> fn(_: &Self, _: f64, _: f64) -> f64
Trait Implementations§
source§impl AudioNodeCommon for PannerNode
impl AudioNodeCommon for PannerNode
fn channel_info(&self) -> &ChannelInfo
fn channel_info_mut(&mut self) -> &mut ChannelInfo
source§impl AudioNodeEngine for PannerNode
impl AudioNodeEngine for PannerNode
fn node_type(&self) -> AudioNodeType
fn process(&mut self, inputs: Chunk, info: &BlockInfo) -> Chunk
fn input_count(&self) -> u32
fn get_param(&mut self, id: ParamType) -> &mut Param
fn set_listenerdata(&mut self, data: Block)
source§fn message_specific(&mut self, message: AudioNodeMessage, _sample_rate: f32)
fn message_specific(&mut self, message: AudioNodeMessage, _sample_rate: f32)
Messages specific to this node
fn message(&mut self, msg: AudioNodeMessage, sample_rate: f32)
fn output_count(&self) -> u32
source§fn channel_count(&self) -> u8
fn channel_count(&self) -> u8
Number of input channels for each input port
fn channel_count_mode(&self) -> ChannelCountMode
fn channel_interpretation(&self) -> ChannelInterpretation
fn set_channel_interpretation(&mut self, i: ChannelInterpretation)
fn set_channel_count(&mut self, c: u8)
fn set_channel_count_mode(&mut self, m: ChannelCountMode)
source§fn destination_data(&mut self) -> Option<Chunk>
fn destination_data(&mut self) -> Option<Chunk>
If we’re the destination node, extract the contained data
Auto Trait Implementations§
impl Freeze for PannerNode
impl RefUnwindSafe for PannerNode
impl Send for PannerNode
impl Sync for PannerNode
impl Unpin for PannerNode
impl UnwindSafe for PannerNode
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