mod button;
mod level;
mod recognizer;
mod state;
mod waveform;
#[cfg(all(feature = "speech", not(target_family = "wasm")))]
mod microphone;
#[cfg(all(feature = "speech", not(target_family = "wasm")))]
mod system;
use std::rc::Rc;
pub use button::SpeechButton;
#[cfg(all(feature = "speech", not(target_family = "wasm")))]
pub use microphone::Microphone;
pub use recognizer::{
AudioFormat, AudioInput, AudioSink, RecognitionSession, SpeechError, SpeechRecognizer,
SpeechSink,
};
pub use state::{SpeechEvent, SpeechState, SpeechStatus};
#[cfg(all(feature = "speech", not(target_family = "wasm")))]
pub use system::SystemRecognizer;
pub use waveform::SpeechWaveform;
fn default_input() -> Option<Rc<dyn AudioInput>> {
#[cfg(all(feature = "speech", not(target_family = "wasm")))]
return Some(Rc::new(Microphone::default()));
#[allow(unreachable_code)]
None
}
fn system_recognizer() -> Option<Rc<dyn SpeechRecognizer>> {
#[cfg(all(feature = "speech", any(target_os = "macos", target_os = "windows")))]
return Some(Rc::new(SystemRecognizer::new()));
#[allow(unreachable_code)]
None
}