Struct Sound

Source
pub struct Sound { /* private fields */ }
Expand description

Sound object

Implementations§

Source§

impl Sound

Source

pub fn get_system_object(&self) -> Result<Sys, Status>

Source

pub fn release(&mut self) -> Status

Source

pub fn play(&self) -> Result<Channel, Status>

Source

pub fn play_with_parameters( &self, paused: bool, channel: &mut Channel, ) -> Status

Source

pub fn play_to_the_end(&self) -> Status

Source

pub fn set_defaults( &self, frequency: f32, volume: f32, pan: f32, priority: i32, ) -> Status

Source

pub fn get_defaults(&self) -> Result<(f32, f32, f32, i32), Status>

Source

pub fn set_variations( &self, frequency_var: f32, volume_var: f32, pan_var: f32, ) -> Status

Source

pub fn get_variations(&self) -> Result<(f32, f32, f32), Status>

Returns:

Ok(frequency_var, volume_var, pan_var)

Source

pub fn set_3D_min_max_distance(&self, min: f32, max: f32) -> Status

Source

pub fn get_3D_min_max_distance(&self) -> Result<(f32, f32), Status>

Returns:

Ok(min, max)

Source

pub fn set_3D_cone_settings( &self, inside_cone_angle: f32, outside_cone_angle: f32, outside_volume: f32, ) -> Status

Source

pub fn get_3D_cone_settings(&self) -> Result<(f32, f32, f32), Status>

Returns:

Ok(inside_cone_angle, outside_cone_angle, outside_volume)

Source

pub fn set_3D_custom_rolloff(&self, points: Vec<Vector>) -> Status

Source

pub fn get_3D_custom_rolloff( &self, num_points: u32, ) -> Result<Vec<Vector>, Status>

Source

pub fn set_sub_sound(&self, index: i32, sub_sound: Sound) -> Status

Source

pub fn get_sub_sound(&self, index: i32) -> Result<Sound, Status>

Source

pub fn get_name(&self, name_len: usize) -> Result<String, RStatus>

Source

pub fn get_length(&self, TimeUnit: TimeUnit) -> Result<u32, Status>

Source

pub fn get_format(&self) -> Result<(SoundType, SoundFormat, i32, i32), Status>

Returns:

Ok(type, format, channels, bits)

Source

pub fn get_num_sub_sounds(&self) -> Result<i32, Status>

Source

pub fn get_num_tags(&self) -> Result<(i32, i32), Status>

Returns:

Ok(num_tags, num_tags_updated)

Source

pub fn get_tag(&self, name: &str, index: i32) -> Result<FmodTag, Status>

Source

pub fn get_open_state(&self) -> Result<(OpenState, u32, bool, bool), Status>

Source

pub fn set_sound_group(&self, sound_group: SoundGroup) -> Status

Source

pub fn get_sound_group(&self) -> Result<SoundGroup, Status>

Source

pub fn get_num_sync_points(&self) -> Result<i32, Status>

Source

pub fn get_sync_point(&self, index: i32) -> Result<FmodSyncPoint, Status>

Source

pub fn get_sync_point_info( &self, sync_point: FmodSyncPoint, name_len: usize, TimeUnit: TimeUnit, ) -> Result<(String, u32), RStatus>

Source

pub fn add_sync_point( &self, offset: u32, TimeUnit: TimeUnit, name: String, ) -> Result<FmodSyncPoint, Status>

Source

pub fn delete_sync_point(&self, sync_point: FmodSyncPoint) -> Status

Source

pub fn set_mode(&self, Mode: Mode) -> Status

Source

pub fn get_mode(&self) -> Result<Mode, Status>

Source

pub fn set_loop_count(&self, loop_count: i32) -> Status

Source

pub fn get_loop_count(&self) -> Result<i32, Status>

Source

pub fn set_loop_points( &self, loop_start: u32, TimeUnit: TimeUnit, loop_end: u32, TimeUnit: TimeUnit, ) -> Status

Source

pub fn get_loop_points( &self, TimeUnit: TimeUnit, TimeUnit: TimeUnit, ) -> Result<(u32, u32), Status>

Returns:

Ok(loop_start, loop_end)

Source

pub fn get_num_channels(&self) -> Result<i32, Status>

Source

pub fn set_music_channel_volume(&self, channel: i32, volume: f32) -> Status

Source

pub fn get_music_channel_volume(&self, channel: i32) -> Result<f32, Status>

Source

pub fn set_music_speed(&self, speed: f32) -> Status

Source

pub fn get_music_speed(&self) -> Result<f32, Status>

Source

pub fn set_sub_sound_sentence(&self, sub_sounds: &mut Vec<i32>) -> Status

Source

pub fn seek_data(&self, pcm: u32) -> Status

Source

pub fn get_memory_info( &self, MemoryBits: MemoryBits, EventMemoryBits: EventMemoryBits, ) -> Result<(u32, MemoryUsageDetails), Status>

Returns:

Ok(memory_used, details)

Source

pub fn lock( &self, offset: u32, length: u32, ) -> Result<(Vec<u8>, Vec<u8>), Status>

Returns:

Ok(ptr1, ptr2)

ptr1: Address of a pointer that will point to the first part of the locked data.

ptr2: Address of a pointer that will point to the second part of the locked data. This will be null if the data locked hasn’t wrapped at the end of the buffer.

Source

pub fn unlock(&self, v_ptr1: Vec<u8>, v_ptr2: Vec<u8>) -> Status

Source

pub fn set_user_data<'r, T>(&'r mut self, user_data: &'r mut T) -> Status

Source

pub fn get_user_data<'r, T>(&'r self) -> Result<&'r mut T, Status>

Source

pub fn save_to_wav(&self, file_name: &str) -> Result<bool, String>

Trait Implementations§

Source§

impl Drop for Sound

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Sound

§

impl RefUnwindSafe for Sound

§

impl !Send for Sound

§

impl !Sync for Sound

§

impl Unpin for Sound

§

impl UnwindSafe for Sound

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.