21 lines
576 B
Rust
21 lines
576 B
Rust
fn main() {
|
|
eprintln!("Voice test: initializing...");
|
|
let voice = match aishell::voice::VoiceSystem::new() {
|
|
Some(v) => v,
|
|
None => {
|
|
eprintln!("Voice system not available. Check ELEVENLABS_API_KEY in .env");
|
|
return;
|
|
}
|
|
};
|
|
|
|
eprintln!("Voice test: listening (speak now)...");
|
|
match voice.listen() {
|
|
Some(text) => {
|
|
eprintln!("Recognized: {text}");
|
|
eprintln!("Speaking back...");
|
|
voice.speak(&text);
|
|
}
|
|
None => eprintln!("No speech detected."),
|
|
}
|
|
}
|