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,
}
๐Deprecated: This project is no longer maintained, use the
hound
crateExpand 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: u16
๐Deprecated: This project is no longer maintained, use the
ยงhound
cratechannel_count: u16
๐Deprecated: This project is no longer maintained, use the
ยงhound
cratesampling_rate: u32
๐Deprecated: This project is no longer maintained, use the
ยงhound
cratebytes_per_second: u32
๐Deprecated: This project is no longer maintained, use the
ยงhound
cratebytes_per_sample: u16
๐Deprecated: This project is no longer maintained, use the
ยงhound
cratebits_per_sample: u16
๐Deprecated: This project is no longer maintained, use the
hound
crateImplementationsยง
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
hound
crateCreates 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);
Trait Implementationsยง
impl Copy for Header
impl Eq for Header
impl StructuralPartialEq for Header
Auto Trait Implementationsยง
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
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