[−][src]Struct wav::Header
Structure for the "fmt " chunk of wave files, specifying key information about the enclosed data. This struct supports only PCM data, which is to say there is no extra members for compressed format data.
Fields
audio_format: u16
channel_count: u16
sampling_rate: u32
bytes_per_second: u32
bytes_per_sample: u16
bits_per_sample: u16
Implementations
impl Header
[src]
pub fn new(af: u16, cc: u16, r: u32, bps: u16) -> Header
[src]
Creates a new Header object.
Parameters
af
- Audio format. 1 for uncompressed PCM data.cc
- Channel count, the number of channels each sample has. Generally 1 (mono) or 2 (stereo).r
- Sampling rate (e.g. 44.1kHz, 48kHz, 96kHz, etc.).bps
- Number of bits in each (sub-channel) sample. Generally 8, 16, or 24.
Example
let h = wav::Header::new(1, 2, 48_000, 16);
Trait Implementations
impl Clone for Header
[src]
impl Copy for Header
[src]
impl Debug for Header
[src]
impl Default for Header
[src]
impl Eq for Header
[src]
impl<'_> From<&'_ [u8]> for Header
[src]
fn from(v: &[u8]) -> Self
[src]
Converts a slice of raw bytes into a Header object.
Panics
This function will panic if the given slice is smaller than 16 bytes.
Parameters
v
- The slice to convert from.
impl From<[u8; 16]> for Header
[src]
fn from(v: [u8; 16]) -> Self
[src]
Converts an array of 16 raw bytes into a Header object. Intended for use with bytes read in from wave files.
Parameters
v
- The raw bytes to convert from.
impl Hash for Header
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Into<[u8; 16]> for Header
[src]
fn into(self) -> [u8; 16]
[src]
Converts the Header object into a vector of its bytes.
Example
let h:[u8;16] = wav::Header::new(1, 2, 48_000, 16).into();
impl PartialEq<Header> for Header
[src]
impl StructuralEq for Header
[src]
impl StructuralPartialEq for Header
[src]
Auto Trait Implementations
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,