wav_io::writer

Struct Writer

Source
pub struct Writer { /* private fields */ }
Expand description

Generate WAV file data

Implementations§

Source§

impl Writer

Source

pub fn new() -> Self

new struct

Source

pub fn write_riff_header( &mut self, head: &WavHeader, samples_len: u32, ) -> Result<(), EncoderError>

write RIFF header

Source

pub fn from_scratch( &mut self, head: &WavHeader, samples: &Vec<f32>, ) -> Result<(), EncoderError>

write sample to bytes

Source

pub fn from_scratch_i( &mut self, head: &WavHeader, samples: &Vec<i32>, ) -> Result<(), EncoderError>

write sample(Vec) to bytes

Source

pub fn from_scratch_i16( &mut self, head: &WavHeader, samples: &Vec<i16>, ) -> Result<(), EncoderError>

write sample(Vec) to bytes

Source

pub fn to_file(&mut self, file: &mut File) -> Result<usize, Error>

write bytes to file

Source

pub fn to_bytes(&mut self) -> Vec<u8>

write bytes to Vec

Source

pub fn write_str(&mut self, tag: &str)

Source

pub fn write_f32(&mut self, v: f32)

Source

pub fn write_f64(&mut self, v: f64)

Source

pub fn write_f32_to_u8(&mut self, v: f32)

Source

pub fn write_f32_to_i24(&mut self, v: f32)

Source

pub fn write_f32_to_i16(&mut self, v: f32)

Source

pub fn write_f32_to_i32(&mut self, v: f32)

Source

pub fn write_u32(&mut self, v: u32)

Source

pub fn write_u24(&mut self, v: u32)

Source

pub fn write_u16(&mut self, v: u16)

Source

pub fn write_u8(&mut self, v: u8)

Source

pub fn write_i16(&mut self, v: i16)

Source

pub fn write_i32(&mut self, v: i32)

Source

pub fn write_i24(&mut self, v: i32)

Source

pub fn i24_to_bytes(v: i32) -> [u8; 3]

Auto Trait Implementations§

§

impl Freeze for Writer

§

impl RefUnwindSafe for Writer

§

impl Send for Writer

§

impl Sync for Writer

§

impl Unpin for Writer

§

impl UnwindSafe for Writer

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.