pub struct AudioTrack { /* private fields */ }Expand description
Seekable digital audio track with PCM samples, precomputed waveform peaks, and transport state.
Implementations§
Source§impl AudioTrack
Transport playback, seeking, and procedural WAV synthesis for AudioTrack.
impl AudioTrack
Transport playback, seeking, and procedural WAV synthesis for AudioTrack.
Sourcepub fn sample_synth_wav() -> Self
pub fn sample_synth_wav() -> Self
Synthesizes a valid RIFF PCM 16-bit mono WAV byte stream and decodes it through MediaCodecRegistry::decode_wav.
§Returns
Self- DecodedAudioTrackwith real PCM samples and 48 waveform peaks.
Sourcepub fn toggle_play(&mut self)
pub fn toggle_play(&mut self)
Source§impl AudioTrack
impl AudioTrack
pub fn get_metadata(&self) -> &MediaMetadata
pub fn get_mut_metadata(&mut self) -> &mut MediaMetadata
pub fn set_metadata(&mut self, val: MediaMetadata) -> &mut Self
pub fn get_codec(&self) -> AudioCodec
pub fn get_mut_codec(&mut self) -> &mut AudioCodec
pub fn set_codec(&mut self, val: AudioCodec) -> &mut Self
pub fn get_samples(&self) -> &Vec<f32>
pub fn get_mut_samples(&mut self) -> &mut Vec<f32>
pub fn set_samples(&mut self, val: Vec<f32>) -> &mut Self
pub fn get_waveform_peaks(&self) -> &Vec<f32>
pub fn get_mut_waveform_peaks(&mut self) -> &mut Vec<f32>
pub fn set_waveform_peaks(&mut self, val: Vec<f32>) -> &mut Self
pub fn get_state(&self) -> PlaybackState
pub fn get_mut_state(&mut self) -> &mut PlaybackState
pub fn set_state(&mut self, val: PlaybackState) -> &mut Self
pub fn get_current_time_secs(&self) -> f32
pub fn get_mut_current_time_secs(&mut self) -> &mut f32
pub fn set_current_time_secs(&mut self, val: f32) -> &mut Self
pub fn get_volume(&self) -> f32
pub fn get_mut_volume(&mut self) -> &mut f32
pub fn set_volume(&mut self, val: f32) -> &mut Self
pub fn get_muted(&self) -> bool
pub fn get_mut_muted(&mut self) -> &mut bool
pub fn set_muted(&mut self, val: bool) -> &mut Self
pub fn get_playback_rate(&self) -> f32
pub fn get_mut_playback_rate(&mut self) -> &mut f32
pub fn set_playback_rate(&mut self, val: f32) -> &mut Self
pub fn get_looping(&self) -> bool
pub fn get_mut_looping(&mut self) -> &mut bool
pub fn set_looping(&mut self, val: bool) -> &mut Self
Trait Implementations§
Source§impl Clone for AudioTrack
impl Clone for AudioTrack
Source§impl Debug for AudioTrack
impl Debug for AudioTrack
Source§impl Default for AudioTrack
impl Default for AudioTrack
Source§impl PartialEq for AudioTrack
impl PartialEq for AudioTrack
impl StructuralPartialEq for AudioTrack
Auto Trait Implementations§
impl Forget for AudioTrack
impl Freeze for AudioTrack
impl Move for AudioTrack
impl RefUnwindSafe for AudioTrack
impl Send for AudioTrack
impl Sync for AudioTrack
impl Unpin for AudioTrack
impl UnsafeUnpin for AudioTrack
impl UnwindSafe for AudioTrack
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more