AudioStream

Struct AudioStream 

Source
pub struct AudioStream<T: FloatType + Float> { /* private fields */ }
Expand description

Shared pointer to an audio stream. NOTE: This is a virtual in-runtime object, not a system-level stream.

Trait Implementations§

Source§

impl<T: FloatType + Float + 'static> AudioStreamImpl<T> for AudioStream<T>

Source§

fn use_normalization(&mut self, norm: bool)

Enables or disables normalization.
Source§

fn is_using_normalization(&self) -> bool

Checks if normalization is enabled.
Source§

fn get_timestamp(&self) -> f64

Gets the current timestamp in seconds.
Source§

fn get_resample_quality(&self) -> ResamplerQuality

Gets the resampler quality.
Source§

fn set_resample_quality(&mut self, quality: ResamplerQuality)

Sets the resampler quality.
Source§

fn get_speed(&self) -> f32

Gets the playback speed (clamped between 0.2 and 8.0).
Source§

fn set_speed(&mut self, speed: f32)

Sets the playback speed (clamped between 0.2 and 8.0).
Source§

fn get_volume(&self) -> f32

Gets the volume level.
Source§

fn set_volume(&self, volume: f32)

Sets the volume level (clamped between 0.0 and 1.0).
Source§

fn use_filter(&mut self, filter: bool)

Enables or disables the filter.
Source§

fn is_using_filter(&self) -> bool

Checks if the filter is enabled.
Source§

fn get_low_cut(&self) -> f32

Gets the low-cut frequency.
Source§

fn set_low_cut(&mut self, low_cut: f32)

Sets the low-cut frequency (clamped between 10.0 and 22050.0 Hz).
Source§

fn get_high_cut(&self) -> f32

Gets the high-cut frequency.
Source§

fn set_high_cut(&mut self, high_cut: f32)

Sets the high-cut frequency (clamped between 10.0 and 22050.0 Hz).
Source§

fn get_sample_rate(&self) -> f32

Gets the sample rate.
Source§

fn set_sample_rate(&mut self, sample_rate: f32)

Sets the sample rate (clamped between 1000.0 and 192000.0 Hz).
Source§

fn get_processor(&self) -> AudioProcessor<T>

Gets a clone of the shared processor.
Source§

fn resume(&mut self)

Resumes the stream if paused.
Source§

fn pause(&mut self)

Pauses the stream.
Source§

fn get_channel_layout(&self) -> AudioChannelLayout

Gets the channel layout.
Source§

fn set_channel_layout(&mut self, layout: AudioChannelLayout)

Sets the channel layout.
Source§

impl<T: Clone + FloatType + Float> Clone for AudioStream<T>

Source§

fn clone(&self) -> AudioStream<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<T> Freeze for AudioStream<T>

§

impl<T> RefUnwindSafe for AudioStream<T>

§

impl<T> !Send for AudioStream<T>

§

impl<T> !Sync for AudioStream<T>

§

impl<T> Unpin for AudioStream<T>

§

impl<T> UnwindSafe for AudioStream<T>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

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.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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

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