AudioStreamImpl

Trait AudioStreamImpl 

Source
pub trait AudioStreamImpl<T: FloatType + Float> {
Show 22 methods // Required methods fn use_normalization(&mut self, norm: bool); fn is_using_normalization(&self) -> bool; fn get_timestamp(&self) -> f64; fn get_resample_quality(&self) -> ResamplerQuality; fn set_resample_quality(&mut self, quality: ResamplerQuality); fn get_speed(&self) -> f32; fn set_speed(&mut self, speed: f32); fn get_volume(&self) -> f32; fn set_volume(&self, volume: f32); fn use_filter(&mut self, filter: bool); fn is_using_filter(&self) -> bool; fn get_low_cut(&self) -> f32; fn set_low_cut(&mut self, low_cut: f32); fn get_high_cut(&self) -> f32; fn set_high_cut(&mut self, high_cut: f32); fn get_sample_rate(&self) -> f32; fn set_sample_rate(&mut self, sample_rate: f32); fn get_channel_layout(&self) -> AudioChannelLayout; fn set_channel_layout(&mut self, layout: AudioChannelLayout); fn get_processor(&self) -> AudioProcessor<T>; fn resume(&mut self); fn pause(&mut self);
}
Expand description

Public API trait for audio streams. This manages stream properties like volume, speed, and filtering.

Required Methods§

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_channel_layout(&self) -> AudioChannelLayout

Gets the channel layout.

Source

fn set_channel_layout(&mut self, layout: AudioChannelLayout)

Sets the channel layout.

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.

Implementors§

Source§

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