[][src]Struct soloud::Soloud

pub struct Soloud { /* fields omitted */ }

Implementations

impl Soloud[src]

pub fn default_uninit() -> MaybeUninit<Self>[src]

Creates an uninitialized instance of a Soloud engine

pub fn init(&mut self) -> Result<(), SoloudError>[src]

initialize an uninitialized instance of Soloud

pub fn default() -> Result<Self, SoloudError>[src]

Creates a default initialized instance of soloud

pub fn init_ex(
    &mut self,
    flags: SoloudFlag,
    samplerate: u32,
    buf_size: u32,
    channels: u32
) -> Result<(), SoloudError>
[src]

initialize an uninitialized instance of Soloud with extra args

pub fn new(
    flags: SoloudFlag,
    samplerate: u32,
    buf_size: u32,
    channels: u32
) -> Result<Self, SoloudError>
[src]

Creates a default initialized instance of soloud

pub fn version(&self) -> u32[src]

Gets the current version of the Soloud library

pub fn backend_id(&self) -> u32[src]

Gets the backend id

pub fn backend_string(&self) -> &'static str[src]

Gets the backend name, it's MINIAUDIO for now!

pub fn backend_channels(&self) -> u32[src]

Get the backend channels

pub fn backend_samplerate(&self) -> u32[src]

Get the backend samplerate

pub fn backend_buffer_size(&self) -> u32[src]

Get the backend buffer size

pub fn set_speaker_position(
    &mut self,
    channel: u32,
    x: f32,
    y: f32,
    z: f32
) -> Result<(), SoloudError>
[src]

Set speaker position

pub fn speaker_position(
    &self,
    channel: u32
) -> Result<(f32, f32, f32), SoloudError>
[src]

Get the speaker position

pub fn play_ex<AS: AudioExt>(
    &self,
    sound: &AS,
    volume: f32,
    pan: f32,
    paused: bool,
    bus: u32
) -> u32
[src]

Play audio with extra args

pub fn play_clocked<AS: AudioExt>(&self, sound_time: f64, sound: &AS) -> u32[src]

Play clocked

pub fn play_clocked_ex<AS: AudioExt>(
    &self,
    sound_time: f64,
    sound: &AS,
    volume: f32,
    pan: f32,
    bus: u32
) -> u32
[src]

Play clocked with extra args

pub fn play_3d<AS: AudioExt>(
    &self,
    sound: &AS,
    pos_x: f32,
    pos_y: f32,
    pos_z: f32
) -> u32
[src]

Play 3D

pub fn play_3d_ex<AS: AudioExt>(
    &self,
    sound: &AS,
    pos_x: f32,
    pos_y: f32,
    pos_z: f32,
    vel_x: f32,
    vel_y: f32,
    vel_z: f32,
    volume: f32,
    paused: bool,
    bus: u32
) -> u32
[src]

Play 3D with extra args

pub fn play_3d_clocked<AS: AudioExt>(
    &self,
    sound_time: f64,
    sound: &AS,
    pos_x: f32,
    pos_y: f32,
    pos_z: f32
) -> u32
[src]

Play 3D clocked

pub fn play_3d_clocked_ex<AS: AudioExt>(
    &self,
    sound_time: f64,
    sound: &AS,
    pos_x: f32,
    pos_y: f32,
    pos_z: f32,
    vel_x: f32,
    vel_y: f32,
    vel_z: f32,
    volume: f32,
    bus: u32
) -> u32
[src]

Play 3D clocked with extra args

pub fn play_background<AS: AudioExt>(&self, sound: &AS) -> u32[src]

Play in the background

pub fn play_background_ex<AS: AudioExt>(
    &self,
    sound: &AS,
    volume: f32,
    paused: bool,
    bus: u32
) -> u32
[src]

Play in the background with extra args

pub fn seek(
    &self,
    voice_handle: Handle,
    seconds: f64
) -> Result<(), SoloudError>
[src]

Seek in seconds

pub fn stop(&self, voice_handle: Handle)[src]

Stop audio by handle

pub fn stop_all(&self)[src]

Stop all audio

pub fn play<T: AudioExt>(&self, sound: &T) -> Handle[src]

Play audio, returns a handle identifying the played audio

pub fn active_voice_count(&self) -> u32[src]

Get active voice count

pub fn voice_count(&self) -> u32[src]

Get voice count

pub fn set_global_volume(&mut self, val: f32)[src]

Set global volume

pub fn stop_audio_source<AS: AudioExt>(&self, sound: &AS)[src]

Stop audio source

pub fn count_audio_source<AS: AudioExt>(&self, sound: &AS) -> i32[src]

Count audio source

pub fn stream_time(&self, voice_handle: Handle) -> f64[src]

Get stream time

pub fn stream_position(&self, voice_handle: Handle) -> f64[src]

Get stream position

pub fn pause(&self, voice_handle: Handle) -> bool[src]

Pause audio

pub fn volume(&self, voice_handle: Handle) -> f32[src]

Get audio volume

pub fn overall_volume(&self, voice_handle: Handle) -> f32[src]

Get overall volume

pub fn pan(&self, voice_handle: Handle) -> f32[src]

Get pan value

pub fn samplerate(&self, voice_handle: Handle) -> f32[src]

Get samplerate of audio

pub fn protect_voice(&self, voice_handle: Handle) -> bool[src]

Return whether protect voice is set

pub fn is_valid_voice_handle(&self, voice_handle: Handle) -> bool[src]

Check whether a handle is a valid voice handle

pub fn relative_play_speed(&self, voice_handle: Handle) -> f32[src]

Get relative play speed

pub fn post_clip_scaler(&self) -> f32[src]

Get post clip scaler

pub fn main_resampler(&self) -> u32[src]

Get main resampler

pub fn global_volume(&self) -> f32[src]

Get global volume

pub fn max_active_voice_count(&self) -> u32[src]

Get max active voice count

pub fn looping(&self, voice_handle: Handle) -> bool[src]

Return whether an audio is looping

pub fn auto_stop(&self, voice_handle: Handle) -> bool[src]

Check whether an audio auto stops

pub fn loop_point(&self, voice_handle: Handle) -> f64[src]

Get loop point

pub fn set_loop_point(&mut self, voice_handle: Handle, loop_point: f64)[src]

Set loop point

pub fn set_looping(&mut self, voice_handle: Handle, flag: bool)[src]

Set whether audio is looping

pub fn set_auto_stop(&mut self, voice_handle: Handle, flag: bool)[src]

Set auto stop

pub fn set_max_active_voice_count(
    &mut self,
    count: u32
) -> Result<(), SoloudError>
[src]

Set max active voice count

pub fn set_inaudible_behavior(
    &mut self,
    voice_handle: Handle,
    must_tick: bool,
    kill: bool
)
[src]

Set inaudible behaviour

pub fn set_post_clip_scaler(&mut self, scaler: f32)[src]

Set post clip scaler

pub fn set_main_resampler(&mut self, resampler: u32)[src]

Set main resampler

pub fn set_pause(&mut self, voice_handle: Handle, flag: bool)[src]

Set whether a handle pauses

pub fn set_pause_all(&mut self, flag: bool)[src]

Set pause for all handles

pub fn set_relative_play_speed(
    &mut self,
    voice_handle: Handle,
    speed: f32
) -> Result<(), SoloudError>
[src]

Set relative play speed

pub fn set_protect_voice(&mut self, voice_handle: Handle, flag: bool)[src]

Set whether an audio source has protect voice

pub fn set_samplerate(&mut self, voice_handle: Handle, samplerate: f32)[src]

Set samplerate

pub fn set_pan(&mut self, voice_handle: Handle, pan: f32)[src]

Set pan

pub fn set_pan_absolute(
    &mut self,
    voice_handle: Handle,
    lvolume: f32,
    rvolume: f32
)
[src]

Set pan absolute

pub fn set_channel_volume(
    &mut self,
    voice_handle: Handle,
    channel: u32,
    volume: f32
)
[src]

Set channel volume

pub fn set_volume(&mut self, voice_handle: Handle, volume: f32)[src]

Set volume by handle

pub fn set_delay_samples(&mut self, voice_handle: Handle, samples: u32)[src]

Set delay samples

pub fn fade_volume(&self, voice_handle: Handle, to: f32, time: f64)[src]

Set up volume fader

pub fn fade_pan(&self, voice_handle: Handle, to: f32, time: f64)[src]

Set up panning fader

pub fn fade_relative_play_speed(&self, voice_handle: Handle, to: f32, time: f64)[src]

Set fader relative play speed

pub fn fade_global_volume(&self, to: f32, time: f64)[src]

Set fader global volume

pub fn schedule_pause(&self, voice_handle: Handle, time: f64)[src]

Schedule a pause

pub fn schedule_stop(&self, voice_handle: Handle, time: f64)[src]

Schedule a stop

pub fn oscillate_volume(
    &self,
    voice_handle: Handle,
    from: f32,
    to: f32,
    time: f64
)
[src]

Set up volume oscillator

pub fn oscillate_pan(&self, voice_handle: Handle, from: f32, to: f32, time: f64)[src]

Set up panning oscillator

pub fn oscillate_relative_play_speed(
    &self,
    voice_handle: Handle,
    from: f32,
    to: f32,
    time: f64
)
[src]

Oscillator relative play speed

pub fn oscillate_global_volume(&self, from: f32, to: f32, time: f64)[src]

Get oscillator global volume

pub fn set_visualize_enable(&self, flag: bool)[src]

Enable visualizations

pub fn calc_fft(&self) -> Vec<f32>[src]

Calculate and get 256 floats of FFT data for visualization. Visualization has to be enabled before use

pub fn wave(&self) -> Vec<f32>[src]

Get 256 floats of wave data for visualization. Visualization has to be enabled before use

pub fn approximate_volume(&self, channel: u32) -> f32[src]

Get approximate volume

pub fn loop_count(&self, voice_handle: Handle) -> u32[src]

Get loop count

pub fn info(&self, voice_handle: Handle, key: u32) -> f32[src]

get info by key

pub fn create_voice_group(&self) -> Handle[src]

Create a voice group

pub fn destroy_voice_group(
    &self,
    voice_group_handle: Handle
) -> Result<(), SoloudError>
[src]

Destroy a voice group

pub fn add_voice_to_group(
    &self,
    voice_group_handle: Handle,
    voice_handle: Handle
) -> Result<(), SoloudError>
[src]

Add a voice handle to a voice group

pub fn is_voice_group(&self, voice_group_handle: Handle) -> bool[src]

Check whether a handle is of a voice group

pub fn is_voice_group_empty(&self, voice_group_handle: Handle) -> bool[src]

Check whether a voice group is empty

pub fn update_3d_audio(&self)[src]

Update 3D audio

pub fn set_3d_sound_speed(&self, speed: f32) -> Result<(), SoloudError>[src]

Set 3D sound speed

pub fn get_3d_sound_speed(&self) -> f32[src]

Get 3d sound speed

pub fn set_3d_listener_params(
    &mut self,
    pos_x: f32,
    pos_y: f32,
    pos_z: f32,
    at_x: f32,
    at_y: f32,
    at_z: f32,
    up_x: f32,
    up_y: f32,
    up_z: f32
)
[src]

Set 3D listener parameters

pub fn set_3d_listener_params_ex(
    &mut self,
    pos_x: f32,
    pos_y: f32,
    pos_z: f32,
    at_x: f32,
    at_y: f32,
    at_z: f32,
    up_x: f32,
    up_y: f32,
    up_z: f32,
    velocity_x: f32,
    velocity_y: f32,
    velocity_z: f32
)
[src]

Set 3D listerner parameters with extra args

pub fn set_3d_listener_position(&mut self, pos_x: f32, pos_y: f32, pos_z: f32)[src]

Set 3D listener position

pub fn set_3d_listener_at(&mut self, at_x: f32, at_y: f32, at_z: f32)[src]

Set 3D listener position with extra params

pub fn set_3d_listener_up(&mut self, up_x: f32, up_y: f32, up_z: f32)[src]

Set up 3D listener

pub fn set_3d_listener_velocity(
    &mut self,
    velocity_x: f32,
    velocity_y: f32,
    velocity_z: f32
)
[src]

Set 3D listener velocity

pub fn set_3d_source_params(
    &mut self,
    voice_handle: Handle,
    pos_x: f32,
    pos_y: f32,
    pos_z: f32
)
[src]

Set 3D source parameters

pub fn set_3d_source_params_ex(
    &mut self,
    voice_handle: Handle,
    pos_x: f32,
    pos_y: f32,
    pos_z: f32,
    velocity_x: f32,
    velocity_y: f32,
    velocity_z: f32
)
[src]

Set 3D source parameters

pub fn set_3d_source_position(
    &mut self,
    voice_handle: Handle,
    pos_x: f32,
    pos_y: f32,
    pos_z: f32
)
[src]

Set 3D source position

pub fn set_3d_source_velocity(
    &mut self,
    voice_handle: Handle,
    velocity_x: f32,
    velocity_y: f32,
    velocity_z: f32
)
[src]

Set 3D source velocity

pub fn set_3d_source_minmax_distance(
    &mut self,
    voice_handle: Handle,
    min_distance: f32,
    max_distance: f32
)
[src]

Set 3D source min and max distances

pub fn set_3d_source_attenuation(
    &mut self,
    voice_handle: Handle,
    model: AttenuationModel,
    rolloff_factor: f32
)
[src]

Set 3D source attenuation

pub fn set_3d_source_doppler_factor(
    &mut self,
    voice_handle: Handle,
    doppler_factor: f32
)
[src]

Set 3D source doppler factor

pub fn set_filter_param(
    &mut self,
    voice_handle: Handle,
    filter_id: u32,
    attr: impl FilterAttr,
    val: f32
)
[src]

Set filter parameters

pub fn filter_param(
    &mut self,
    voice_handle: Handle,
    filter_id: u32,
    attr: impl FilterAttr
) -> f32
[src]

Get filter parameter by filter id

pub fn fade_filter_param(
    &mut self,
    voice_handle: Handle,
    filter_id: u32,
    attr: impl FilterAttr,
    to: f32,
    time: f64
)
[src]

Get fader filter params

pub fn oscillate_filter_param(
    &mut self,
    voice_handle: Handle,
    filter_id: u32,
    attr: impl FilterAttr,
    from: f32,
    to: f32,
    time: f64
)
[src]

Get oscillator filter params

pub fn set_global_filter(&mut self, filter_id: u32, filter: impl FilterExt)[src]

Set a global filter

Trait Implementations

impl Drop for Soloud[src]

impl Send for Soloud[src]

impl Sync for Soloud[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.