[][src]Struct floaout::format::wav::Wav

pub struct Wav {
    pub riff_size: u32,
    pub format_size: u32,
    pub format_tag: u16,
    pub channels: u16,
    pub sampling_rate: u32,
    pub data_rate: u32,
    pub data_block_size: u16,
    pub bits_per_sample: u16,
    pub data_size: u32,
    pub other_size: u32,
}

Details of the Wav file.

Fields

riff_size: u32

Riff Size is (file size - 8).

format_size: u32

Format Size

format_tag: u16

Format Tag

channels: u16

Channels

sampling_rate: u32

Sampling Rate

data_rate: u32

Data Rate

data_block_size: u16

Data Block Size

bits_per_sample: u16

Bits Per Sample

data_size: u32

Data Size

other_size: u32

Other Size is not exsists in a file. However, this will help erasing other chunk.

Methods

impl Wav[src]

pub fn from_bits_per_sample(bits_per_sample: u16) -> Self[src]

This method casts bits per sample to Wav.

Examples

use floaout::format::wav::Wav;
 
let wav = Wav::from_bits_per_sample(32);
 
assert_eq!(
    wav,
    Wav {
        bits_per_sample: 32,
        ..Default::default()
    }
);

pub fn bytes_per_sample(self) -> u16[src]

This method returns bytes per sample.

Examples

use floaout::format::wav::Wav;
 
let wav = Wav {
    bits_per_sample: 32,
    ..Default::default()
};
 
let bytes_per_sample = wav.bytes_per_sample();
 
assert_eq!(bytes_per_sample, 4);

pub fn blocks(self) -> u64[src]

This method predicts blocks from Wav.

Examples

use floaout::format::wav::Wav;
 
let wav = Wav {
    channels: 1,
    bits_per_sample: 32,
    data_size: 16,
    ..Default::default()
};
 
let blocks = wav.blocks();
 
assert_eq!(blocks, 4);

Trait Implementations

impl Clone for Wav[src]

impl Copy for Wav[src]

impl Debug for Wav[src]

impl Default for Wav[src]

impl Display for Wav[src]

impl Eq for Wav[src]

impl Hash for Wav[src]

impl Ord for Wav[src]

impl PartialEq<Wav> for Wav[src]

impl PartialOrd<Wav> for Wav[src]

impl<'_, R: Read + ?Sized> ReadBlock<&'_ Wav, WavBlock> for R[src]

impl<R: Read + Seek> ReadFmt<Wav, WavBlocks> for BufReader<R>[src]

impl StructuralEq for Wav[src]

impl StructuralPartialEq for Wav[src]

impl TryFrom<Wav> for Bubble[src]

type Error = &'static str

The type returned in the event of a conversion error.

impl TryInto<Wav> for Bubble[src]

type Error = &'static str

The type returned in the event of a conversion error.

impl<'_, W: Write + ?Sized> WriteBlock<&'_ Wav, WavBlock> for W[src]

impl<W: Write> WriteFmt<Wav, WavBlocks> for BufWriter<W>[src]

Auto Trait Implementations

impl RefUnwindSafe for Wav

impl Send for Wav

impl Sync for Wav

impl Unpin for Wav

impl UnwindSafe for Wav

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.