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§
Sourcefn use_normalization(&mut self, norm: bool)
fn use_normalization(&mut self, norm: bool)
Enables or disables normalization.
Sourcefn is_using_normalization(&self) -> bool
fn is_using_normalization(&self) -> bool
Checks if normalization is enabled.
Sourcefn get_timestamp(&self) -> f64
fn get_timestamp(&self) -> f64
Gets the current timestamp in seconds.
Sourcefn get_resample_quality(&self) -> ResamplerQuality
fn get_resample_quality(&self) -> ResamplerQuality
Gets the resampler quality.
Sourcefn set_resample_quality(&mut self, quality: ResamplerQuality)
fn set_resample_quality(&mut self, quality: ResamplerQuality)
Sets the resampler quality.
Sourcefn get_volume(&self) -> f32
fn get_volume(&self) -> f32
Gets the volume level.
Sourcefn set_volume(&self, volume: f32)
fn set_volume(&self, volume: f32)
Sets the volume level (clamped between 0.0 and 1.0).
Sourcefn use_filter(&mut self, filter: bool)
fn use_filter(&mut self, filter: bool)
Enables or disables the filter.
Sourcefn is_using_filter(&self) -> bool
fn is_using_filter(&self) -> bool
Checks if the filter is enabled.
Sourcefn get_low_cut(&self) -> f32
fn get_low_cut(&self) -> f32
Gets the low-cut frequency.
Sourcefn set_low_cut(&mut self, low_cut: f32)
fn set_low_cut(&mut self, low_cut: f32)
Sets the low-cut frequency (clamped between 10.0 and 22050.0 Hz).
Sourcefn get_high_cut(&self) -> f32
fn get_high_cut(&self) -> f32
Gets the high-cut frequency.
Sourcefn set_high_cut(&mut self, high_cut: f32)
fn set_high_cut(&mut self, high_cut: f32)
Sets the high-cut frequency (clamped between 10.0 and 22050.0 Hz).
Sourcefn get_sample_rate(&self) -> f32
fn get_sample_rate(&self) -> f32
Gets the sample rate.
Sourcefn set_sample_rate(&mut self, sample_rate: f32)
fn set_sample_rate(&mut self, sample_rate: f32)
Sets the sample rate (clamped between 1000.0 and 192000.0 Hz).
Sourcefn get_channel_layout(&self) -> AudioChannelLayout
fn get_channel_layout(&self) -> AudioChannelLayout
Gets the channel layout.
Sourcefn set_channel_layout(&mut self, layout: AudioChannelLayout)
fn set_channel_layout(&mut self, layout: AudioChannelLayout)
Sets the channel layout.
Sourcefn get_processor(&self) -> AudioProcessor<T>
fn get_processor(&self) -> AudioProcessor<T>
Gets a clone of the shared processor.