[−][src]Struct cauldron::audio::AudioSegment
AudioSegment
is returned to user to perform various operations and get
decoded stream, audio info or encode to different format.
Methods
impl AudioSegment
[src]
pub fn read(filename: &'static str, flag: CodecFlag) -> Result<AudioSegment>
[src]
Constructs a new AudioSegment
.
Example
use cauldron::audio::AudioSegment; use cauldron::codecs::CodecFlag; match AudioSegment::read("./samples/wav/test-s24le.wav", CodecFlag::WAV) { Ok(f) => f, Err(e) => panic!("Couldn't open example file: {}", e) };
read audio file from file path and returns AudioSegment
pub fn info(&self) -> AudioInfo
[src]
returns audio info as AudioInfo
pub fn number_channels(&self) -> usize
[src]
pub fn duration(&self) -> f32
[src]
Returns the duration of the audio file in seconds
duration = (total_samples / no_channels) / sampling_rate
pub fn bitrate(&self) -> u32
[src]
Returns bitrate of the audio in kbps
pub fn samples<'a, S: Sample + 'a>(
&'a mut self
) -> Box<dyn AudioSamplesIterator<S> + 'a>
[src]
&'a mut self
) -> Box<dyn AudioSamplesIterator<S> + 'a>
Returns an iterator on samples
Trait Implementations
Auto Trait Implementations
impl !Send for AudioSegment
impl !Sync for AudioSegment
impl Unpin for AudioSegment
impl !UnwindSafe for AudioSegment
impl !RefUnwindSafe for AudioSegment
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,