pub struct Audio {}Expand description
A interface of an audio player.
Implementations§
Source§impl Audio
impl Audio
Sourcepub fn set_sound_speed(val: f32)
pub fn set_sound_speed(val: f32)
Sets The speed of the 3D sound.
Sourcepub fn get_sound_speed() -> f32
pub fn get_sound_speed() -> f32
Gets The speed of the 3D sound.
Sourcepub fn set_global_volume(val: f32)
pub fn set_global_volume(val: f32)
Sets The global volume of the audio. The value is between 0.0 and 1.0.
Sourcepub fn get_global_volume() -> f32
pub fn get_global_volume() -> f32
Gets The global volume of the audio. The value is between 0.0 and 1.0.
Sourcepub fn set_listener(val: &dyn INode)
pub fn set_listener(val: &dyn INode)
Sets The 3D listener as a node of the audio.
Sourcepub fn get_listener() -> Option<Node>
pub fn get_listener() -> Option<Node>
Gets The 3D listener as a node of the audio.
Sourcepub fn stop(handle: i32)
pub fn stop(handle: i32)
Stops a sound effect that is currently playing.
§Arguments
handler- The handler for the audio that is returned by theplayfunction.
Sourcepub fn play_stream(filename: &str, looping: bool, cross_fade_time: f32)
pub fn play_stream(filename: &str, looping: bool, cross_fade_time: f32)
Plays a streaming audio file.
§Arguments
filename- The path to the streaming audio file (can be OGG, WAV, MP3, or FLAC).loop- Whether to loop the streaming audio.crossFadeTime- The time (in seconds) to crossfade between the previous and new streaming audio.
Sourcepub fn stop_stream(fade_time: f32)
pub fn stop_stream(fade_time: f32)
Stops a streaming audio file that is currently playing.
§Arguments
fade_time- The time (in seconds) to fade out the streaming audio.
Sourcepub fn set_pause_all_current(pause: bool)
pub fn set_pause_all_current(pause: bool)
Sourcepub fn set_listener_at(at_x: f32, at_y: f32, at_z: f32)
pub fn set_listener_at(at_x: f32, at_y: f32, at_z: f32)
Sets the position of the 3D listener.
§Arguments
atX- The X coordinate of the listener position.atY- The Y coordinate of the listener position.atZ- The Z coordinate of the listener position.
Auto Trait Implementations§
impl Freeze for Audio
impl RefUnwindSafe for Audio
impl Send for Audio
impl Sync for Audio
impl Unpin for Audio
impl UnwindSafe for Audio
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