pub struct DsfFile { /* private fields */ }Expand description
In memory representation of a DSF file.
The DSF File Format Specification divides a DSF file into four chunks:
- DSD chunk: basic file headers, size and pointers to other chunks.
- Fmt chunk: information about the audio format e.g. sampling rate, etc.
- Data chunk: the audio samples.
- Metadata chunk: an optional
ID3v2metadata tag.
The fields of the DsfFile struct reflect this specification,
with an additional File field for the underlying file,
and a Tag read error field to store any error that occurred while reading the ID3 tag.
Implementations§
Source§impl DsfFile
impl DsfFile
Sourcepub fn open(path: &Path) -> Result<DsfFile, Error>
pub fn open(path: &Path) -> Result<DsfFile, Error>
Attempt to open and parse the metadata of DSF file in read-only mode. Sample data is not read into memory to keep the memory footprint small.
§Errors
This function will return an error if path does not exist or
is not a readable and valid DSF file.
§Examples
use dsf_meta::DsfFile;
use std::path::Path;
let path = Path::new("my/music.dsf");
match DsfFile::open(path) {
Ok(dsf_file) => {
println!("DSF file metadata:\n\n{}", dsf_file);
}
Err(error) => {
println!("Error: {}", error);
}
}Sourcepub fn data_chunk(&self) -> &DataChunk
pub fn data_chunk(&self) -> &DataChunk
Return a reference to the DataChunk.
Sourcepub fn tag_read_err(&self) -> Option<&Error>
pub fn tag_read_err(&self) -> Option<&Error>
Return the error if attempt to read the ID3 tag failed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DsfFile
impl !RefUnwindSafe for DsfFile
impl Send for DsfFile
impl Sync for DsfFile
impl Unpin for DsfFile
impl !UnwindSafe for DsfFile
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