[][src]Struct ears::Recorder

pub struct Recorder { /* fields omitted */ }

Record audio

This class provide easy audio recording using. The Recorder allow the user to record sound, then save it in a file, or create a SoundData object to play the recorded sound in the same program. A special context, RecordContext is needed to create the Recorder object. The Recorder work in it's own task.

Examples

use ears::Recorder;

fn main() -> () {
    // Create a new context to record audio
    let context = ears::init_in().unwrap();
    // Create the recorder
    let mut recorder = Recorder::new(context);
    // Start to record something
    recorder.start();

    // Do some other stuff here

    // Stop the recorder
    recorder.stop();
    // Then store the recorded data in a file
    recorder.save_to_file("hello_file");
}

Methods

impl Recorder[src]

pub fn new(record_context: RecordContext) -> Recorder[src]

Create a new audio recorder

pub fn start(&mut self)[src]

pub fn stop(&mut self) -> bool[src]

pub fn save_to_file(&mut self, filename: &str) -> bool[src]

Auto Trait Implementations

impl Send for Recorder

impl Unpin for Recorder

impl !Sync for Recorder

impl !UnwindSafe for Recorder

impl !RefUnwindSafe for Recorder

Blanket Implementations

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.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]