[][src]Struct dsf::FmtChunk

pub struct FmtChunk { /* fields omitted */ }

The fmt chunk contains information about the audio format.

  • Channel type: mono, stereo, 5.1, etc.
  • Channel number: 1 for mono, 2 for stereo, etc.
  • Sampling frequency: the DSD sampling frequency.
  • Bits per sample: whether the samples are big or little endian encoded.
  • Block size per channel: this should always be 4096 bytes.

Methods

impl FmtChunk[src]

pub fn channel_type(&self) -> &ChannelType[src]

Return a reference to the ChannelType.

pub fn channel_num(&self) -> u32[src]

Return the number of channels. This should be in the range 1 to 6.

pub fn sampling_frequency(&self) -> u32[src]

Return the sampling freqency. DSD sampling frequencies are much higher than PCM because of the 1-bit sampling, so you should get values like:

  • 2822400 Hz for DSD64
  • 5644800 Hz for DSD128
  • 11289600 Hz for DSD256

and so on.

pub fn bits_per_sample(&self) -> u32[src]

Returns the bits_per_sample field. This is a bit of a misnomer in my opinion, but that’s what’s in the DSF specification. If it is equal to 1 then the sample data is stored least significant bit first. If it is equal to 8 then the sample data is stored most significant bit first.

pub fn sample_count(&self) -> u64[src]

Return the number of DSD samples per channel.

pub fn block_size_per_channel(&self) -> u32[src]

Return the block size per channel in bytes. This is fixed and should always be 4096 bytes.

Trait Implementations

impl Display for FmtChunk[src]

impl TryFrom<[u8; 52]> for FmtChunk[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

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.