[−][src]Struct ears::Recorder
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]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,