FlacBuilder

Struct FlacBuilder 

Source
pub struct FlacBuilder<'data, Sample>
where Sample: IntoSample,
{ /* private fields */ }

Implementations§

Source§

impl<'data, Sample: IntoSample> FlacBuilder<'data, Sample>

Source

pub fn from_planar(data: &'data [Vec<Sample>], sample_rate: u32) -> Self

New with planar audio data. The input data must be a list of channels where each channel is a list of frames/samples. Samples can be either f32 or f64 in range [-1.0, 1.0] or anything you implement IntoSample on.

Source

pub fn from_interleaved( data: &'data [Sample], channels: usize, sample_rate: u32, ) -> Self

New with interleaved (e.g. LRLRLRLRLRLR) audio data. Samples can be either f32 or f64 in range [-1.0, 1.0] or anything you implement IntoSample on.

Source

pub fn compression_level(self, level: u32) -> Self

See here.

Source

pub fn bps(self, bps: BpsLevel) -> Self

Set bits per sample.

Source

pub fn padding(self, padding: u32) -> Self

Source

pub fn artist(self, artist: &str) -> Self

Source

pub fn album(self, album: &str) -> Self

Source

pub fn title(self, title: &str) -> Self

Source

pub fn year(self, year: u32) -> Self

Source

pub fn track_number(self, number: i32) -> Self

Source

pub fn vorbis_comment(self, key: &str, value: &str) -> Self

Source

pub fn write_file(self, path: impl AsRef<Path>) -> Result<(), EncoderError>

Source

pub fn build(self) -> Result<Vec<u8>, EncoderError>

Trait Implementations§

Source§

impl<'data, Sample: IntoSample> Drop for FlacBuilder<'data, Sample>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'data, Sample> Freeze for FlacBuilder<'data, Sample>

§

impl<'data, Sample> RefUnwindSafe for FlacBuilder<'data, Sample>
where Sample: RefUnwindSafe,

§

impl<'data, Sample> !Send for FlacBuilder<'data, Sample>

§

impl<'data, Sample> !Sync for FlacBuilder<'data, Sample>

§

impl<'data, Sample> Unpin for FlacBuilder<'data, Sample>

§

impl<'data, Sample> UnwindSafe for FlacBuilder<'data, Sample>
where Sample: RefUnwindSafe,

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.