Skip to main content

AudioFileMetadata

Trait AudioFileMetadata 

Source
pub trait AudioFileMetadata {
    // Required methods
    fn open_metadata<P: AsRef<Path>>(path: P) -> AudioIOResult<Self>
       where Self: Sized;
    fn base_info(&self) -> AudioIOResult<BaseAudioInfo>;
    fn specific_info(&self) -> impl AudioInfoMarker;
    fn file_type(&self) -> FileType;
    fn file_path(&self) -> &Path;
    fn total_samples(&self) -> usize;
    fn duration(&self) -> AudioIOResult<Duration>;
    fn sample_type(&self) -> ValidatedSampleType;
    fn num_channels(&self) -> u16;

    // Provided methods
    fn info(&self) -> AudioIOResult<AudioInfo<impl AudioInfoMarker>> { ... }
    fn samples_per_channel(&self) -> AudioIOResult<usize> { ... }
}

Required Methods§

Source

fn open_metadata<P: AsRef<Path>>(path: P) -> AudioIOResult<Self>
where Self: Sized,

Open file for metadata operations only (no sample type needed)

Source

fn base_info(&self) -> AudioIOResult<BaseAudioInfo>

Get basic audio information from file headers

Source

fn specific_info(&self) -> impl AudioInfoMarker

Get format-specific audio information

Source

fn file_type(&self) -> FileType

Get the file format type

Source

fn file_path(&self) -> &Path

Get the file path

Source

fn total_samples(&self) -> usize

Get total number of samples in the file

Source

fn duration(&self) -> AudioIOResult<Duration>

Get duration of the audio

Source

fn sample_type(&self) -> ValidatedSampleType

Get the sample data type of the audio file SampleType should be validated during file opening

Source

fn num_channels(&self) -> u16

Get the number of channels in the audio file

Provided Methods§

Source

fn info(&self) -> AudioIOResult<AudioInfo<impl AudioInfoMarker>>

Get complete audio information (base + specific)

Source

fn samples_per_channel(&self) -> AudioIOResult<usize>

Get samples per channel

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§