[][src]Struct alass_util::AudioSink

pub struct AudioSink {
    pub state: AudioSinkState,
    // some fields omitted
}

Receives audio samples to be processed for voice-activity and used as reference by the synchronization process

Fields

state: AudioSinkState

Methods

impl AudioSink[src]

pub fn send_samples(
    self: &mut AudioSink,
    samples: &[i16]
) -> Result<(), AudioSinkError>
[src]

Recieve incoming samples

Voice-activity data is processed on the fly in CHUNK_SAMPLES sized chunks. Remaining samples are buffered until the next invocation or the AudioSink is closed.

pub fn close(self: &mut AudioSink) -> Result<(), AudioSinkError>[src]

Closes the AudioSink

This flushes any remaining samples and finishes processing voice-activity. AudioSink will no longer accept samples once closed.

pub fn voice_activity(&mut self) -> VoiceActivity[src]

Returns voice-activity data, closing the AudioSink if it has not been already

pub fn load_sample_data(filename: &str) -> Result<Vec<i16>, Error>[src]

Loads sample data from file (for debugging)

pub fn load_vad_data(filename: &str) -> Result<Vec<bool>, Error>[src]

Loads voice-activity data from file (for debugging)

Trait Implementations

impl Default for AudioSink[src]

fn default() -> Self[src]

Creates a new AudioSink instance ready to accept sample data

Auto Trait Implementations

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, 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.