pub trait AudioInput: 'static {
// Required method
fn start(
&self,
format: AudioFormat,
sink: AudioSink,
cx: &mut App,
) -> Result<Subscription, SpeechError>;
}Expand description
A source of audio for a SpeechState, such as the microphone.
Enable the speech feature for the built-in Microphone,
or implement this trait to feed audio from elsewhere, e.g. a file in tests.
Required Methods§
Sourcefn start(
&self,
format: AudioFormat,
sink: AudioSink,
cx: &mut App,
) -> Result<Subscription, SpeechError>
fn start( &self, format: AudioFormat, sink: AudioSink, cx: &mut App, ) -> Result<Subscription, SpeechError>
Start capturing format audio into sink.
Capture runs until the returned Subscription is dropped.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".