pub struct FmtChunk { /* private fields */ }Expand description
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.
Implementations§
Source§impl FmtChunk
impl FmtChunk
Sourcepub fn channel_type(&self) -> &ChannelType
pub fn channel_type(&self) -> &ChannelType
Return a reference to the
ChannelType.
Sourcepub fn channel_num(&self) -> u32
pub fn channel_num(&self) -> u32
Return the number of channels. This should be in the range 1 to 6.
Sourcepub fn sampling_frequency(&self) -> u32
pub fn sampling_frequency(&self) -> u32
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.
Sourcepub fn bits_per_sample(&self) -> u32
pub fn bits_per_sample(&self) -> u32
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.
Sourcepub fn sample_count(&self) -> u64
pub fn sample_count(&self) -> u64
Return the number of DSD samples per channel.
Sourcepub fn block_size_per_channel(&self) -> u32
pub fn block_size_per_channel(&self) -> u32
Return the block size per channel in bytes. This is fixed and should always be 4096 bytes.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FmtChunk
impl RefUnwindSafe for FmtChunk
impl Send for FmtChunk
impl Sync for FmtChunk
impl Unpin for FmtChunk
impl UnwindSafe for FmtChunk
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