[][src]Struct dsf::DsfFile

pub struct DsfFile { /* fields omitted */ }

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 ID3v2 metadata tag.

The fields of the DsfFile struct reflect this specification, with an additional File field for the underlying file.

Methods

impl DsfFile[src]

pub fn open(path: &Path) -> Result<DsfFile, Error>[src]

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::DsfFile;
 use std::path::Path;

 fn main() {
    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);
        }
    }
 }

pub fn file(&self) -> &File[src]

Return a reference to the underlying File.

pub fn dsd_chunk(&self) -> &DsdChunk[src]

Return a reference to the DsdChunk.

pub fn fmt_chunk(&self) -> &FmtChunk[src]

Return a reference to the FmtChunk.

pub fn data_chunk(&self) -> &DataChunk[src]

Return a reference to the DataChunk.

pub fn id3_tag(&self) -> &Option<Tag>[src]

Return a reference to the optional ID3v2 Tag.

pub fn frames(&mut self) -> Result<Frames, Error>[src]

Return a representation of the sample data as Frames.

pub fn interleaved_u32_samples_iter(
    &mut self
) -> Result<InterleavedU32SamplesIter, Error>
[src]

Return an InterleavedU32SamplesIter for the sample data contained in this DSF file.

Trait Implementations

impl Display for DsfFile[src]

Auto Trait Implementations

impl RefUnwindSafe for DsfFile

impl Send for DsfFile

impl Sync for DsfFile

impl Unpin for DsfFile

impl UnwindSafe for DsfFile

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.