Skip to main content

Output

Struct Output 

Source
pub struct Output { /* private fields */ }

Implementations§

Source§

impl Output

Source

pub fn open() -> Result<Output, String>

Source

pub fn rate(&self) -> u32

Source

pub fn channels(&self) -> u16

Source

pub fn play(&self, clip: &Clip, level: Level) -> VoiceId

Source

pub fn set_volume(&self, id: VoiceId, volume: f32)

Source

pub fn set_pan(&self, id: VoiceId, pan: f32)

Source

pub fn play_on(&self, channel: ChannelId, clip: &Clip, level: Level) -> VoiceId

Source

pub fn stop(&self, id: VoiceId, fade_seconds: f32)

Source

pub fn set_master_volume(&self, volume: f32)

Source

pub fn set_master_muted(&self, muted: bool)

Source

pub fn set_channel_volume(&self, channel: ChannelId, volume: f32)

Source

pub fn set_channel_muted(&self, channel: ChannelId, muted: bool)

Source

pub fn set_ducking(&self, ducking: Option<Ducking>)

Source

pub fn set_pitch(&self, id: VoiceId, ratio: f32)

Source

pub fn glide_pitch(&self, id: VoiceId, ratio: f32, seconds: f32)

Source

pub fn set_gain(&self, id: VoiceId, gain: f32)

Source

pub fn glide_gain(&self, id: VoiceId, gain: f32, seconds: f32)

Source

pub fn set_channel_pitch(&self, channel: ChannelId, ratio: f32)

Source

pub fn glide_channel_pitch(&self, channel: ChannelId, ratio: f32, seconds: f32)

Source

pub fn set_channel_lowpass(&self, channel: ChannelId, hz: Option<f32>)

Source

pub fn set_channel_highpass(&self, channel: ChannelId, hz: Option<f32>)

Source

pub fn set_limiter(&self, threshold: Option<f32>)

Source

pub fn set_seed(&self, seed: u64)

Source

pub fn sound(&self, clip: &Clip, spec: SoundSpec) -> SoundId

Source

pub fn trigger(&self, sound: SoundId) -> Option<VoiceId>

Source

pub fn tone( &self, channel: ChannelId, wave: Wave, hz: f32, volume: f32, ) -> VoiceId

Source

pub fn tone_in( &self, offset: u64, channel: ChannelId, wave: Wave, hz: f32, volume: f32, ) -> VoiceId

Source

pub fn tone_sound( &self, wave: Wave, hz: f32, seconds: Option<f32>, spec: SoundSpec, ) -> SoundId

Source

pub fn trigger_in(&self, offset: u64, sound: SoundId) -> Option<VoiceId>

Source

pub fn trigger_with(&self, sound: SoundId, volume: f32) -> Option<VoiceId>

Source

pub fn trigger_in_with( &self, offset: u64, sound: SoundId, volume: f32, ) -> Option<VoiceId>

Source

pub fn set_resample(&self, id: VoiceId, resample: Resample)

Source

pub fn set_tone_frequency(&self, id: VoiceId, hz: f32)

Source

pub fn glide_tone_frequency(&self, id: VoiceId, hz: f32, seconds: f32)

Source

pub fn pcm_stream( &self, channel: ChannelId, channels: u16, capacity_seconds: f32, level: Level, ) -> (VoiceId, PcmSender)

Source

pub fn play_music( &self, track: &MusicTrack, fade_seconds: f32, level: Level, ) -> VoiceId

Source

pub fn stop_music(&self, fade_seconds: f32)

Source

pub fn music_heard(&self) -> Option<f64>

Source

pub fn stream_vorbis( &self, channel: ChannelId, source: &VorbisSource, looping: Option<(u64, u64)>, level: Level, ) -> Result<VoiceId, String>

Source

pub fn play_music_vorbis( &self, source: &VorbisSource, looping: Option<(u64, u64)>, fade_seconds: f32, level: Level, ) -> Result<VoiceId, String>

Source

pub fn stream(&self, spec: &DecodeSpec, level: Level) -> Result<VoiceId, String>

Trait Implementations§

Source§

impl Drop for Output

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl !Freeze for Output

§

impl !RefUnwindSafe for Output

§

impl Send for Output

§

impl Sync for Output

§

impl Unpin for Output

§

impl UnsafeUnpin for Output

§

impl !UnwindSafe for Output

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.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

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.

§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

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.
§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,