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§
Sourcefn open_metadata<P: AsRef<Path>>(path: P) -> AudioIOResult<Self>where
Self: Sized,
fn open_metadata<P: AsRef<Path>>(path: P) -> AudioIOResult<Self>where
Self: Sized,
Open file for metadata operations only (no sample type needed)
Sourcefn base_info(&self) -> AudioIOResult<BaseAudioInfo>
fn base_info(&self) -> AudioIOResult<BaseAudioInfo>
Get basic audio information from file headers
Sourcefn specific_info(&self) -> impl AudioInfoMarker
fn specific_info(&self) -> impl AudioInfoMarker
Get format-specific audio information
Sourcefn total_samples(&self) -> usize
fn total_samples(&self) -> usize
Get total number of samples in the file
Sourcefn duration(&self) -> AudioIOResult<Duration>
fn duration(&self) -> AudioIOResult<Duration>
Get duration of the audio
Sourcefn sample_type(&self) -> ValidatedSampleType
fn sample_type(&self) -> ValidatedSampleType
Get the sample data type of the audio file SampleType should be validated during file opening
Sourcefn num_channels(&self) -> u16
fn num_channels(&self) -> u16
Get the number of channels in the audio file
Provided Methods§
Sourcefn info(&self) -> AudioIOResult<AudioInfo<impl AudioInfoMarker>>
fn info(&self) -> AudioIOResult<AudioInfo<impl AudioInfoMarker>>
Get complete audio information (base + specific)
Sourcefn samples_per_channel(&self) -> AudioIOResult<usize>
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", so this trait is not object safe.