pub struct Header {
pub audio_format: u16,
pub channel_count: u16,
pub sampling_rate: u32,
pub bytes_per_second: u32,
pub bytes_per_sample: u16,
pub bits_per_sample: u16,
}This project is no longer maintained, use the hound crate
Expand description
Structure for the "fmt " chunk of wave files, specifying key information about the enclosed
data.
This struct supports only PCM and IEEE float data, which is to say there is no extra members for compressed format data.
Fieldsยง
ยงaudio_format: u16This project is no longer maintained, use the hound crate
channel_count: u16This project is no longer maintained, use the hound crate
sampling_rate: u32This project is no longer maintained, use the hound crate
bytes_per_second: u32This project is no longer maintained, use the hound crate
bytes_per_sample: u16This project is no longer maintained, use the hound crate
bits_per_sample: u16This project is no longer maintained, use the hound crate
Implementationsยง
Sourceยงimpl Header
impl Header
Sourcepub fn new(
audio_format: u16,
channel_count: u16,
sampling_rate: u32,
bits_per_sample: u16,
) -> Header
๐Deprecated: This project is no longer maintained, use the hound crate
pub fn new( audio_format: u16, channel_count: u16, sampling_rate: u32, bits_per_sample: u16, ) -> Header
This project is no longer maintained, use the hound crate
Creates a new Header object.
ยงNote
While the crate::read and crate::write functions only support uncompressed PCM/IEEE
for the audio format, the option is given here to select any audio format for custom
implementations of wave features.
ยงParameters
audio_format- Audio format. OnlyWAV_FORMAT_PCM(0x01) andWAV_FORMAT_IEEE_FLOAT(0x03) are supported.channel_count- Channel count. The number of channels each sample has. Generally 1 (mono) or 2 (stereo).sampling_rate- Sampling rate (e.g. 44.1kHz, 48kHz, 96kHz, etc.).bits_per_sample- Number of bits in each (sub-channel) sample. Generally 8, 16, 24, or 32.
ยงExample
let h = wav::Header::new(wav::header::WAV_FORMAT_PCM, 2, 48_000, 16);