[][src]Struct bwavfile::WaveFmt

pub struct WaveFmt {
    pub tag: u16,
    pub channel_count: u16,
    pub sample_rate: u32,
    pub bytes_per_second: u32,
    pub block_alignment: u16,
    pub bits_per_sample: u16,
    pub extended_format: Option<WaveFmtExtended>,
}

WAV file data format record.

The fmt record contains essential information describing the binary structure of the data segment of the WAVE file, such as sample rate, sample binary format, channel count, etc.

Fields

tag: u16

A tag identifying the codec in use.

If this is 0xFFFE, the codec will be identified by a GUID in extended_format

channel_count: u16

Count of audio channels in each frame

sample_rate: u32

Sample rate of the audio data

bytes_per_second: u32

Count of bytes per second

By rule, this is block_alignment * sample_rate

block_alignment: u16

Count of bytes per audio frame

By rule, this is channel_count * bits_per_sample / 8

bits_per_sample: u16

Count of bits stored in the file per sample

extended_format: Option<WaveFmtExtended>

Extended format description

Additional format metadata if channel_count is greater than 2, or if certain codecs are used.

Implementations

impl WaveFmt[src]

pub fn new_pcm(
    sample_rate: u32,
    bits_per_sample: u16,
    channel_count: u16
) -> Self
[src]

Create a new integer PCM format WaveFmt

Trait Implementations

impl Debug for WaveFmt[src]

Auto Trait Implementations

impl RefUnwindSafe for WaveFmt

impl Send for WaveFmt

impl Sync for WaveFmt

impl Unpin for WaveFmt

impl UnwindSafe for WaveFmt

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, 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.