Skip to content
Introducing AI Conversations: Natural Language Interaction for Your Apps! Learn More

Wake Word

Wake word detection enables a hands-free “Hey Siri” style experience. The service listens continuously for a keyword phrase, captures the user’s utterance that follows, and sends it to the AI automatically.

await aiService.StartWakeWord("Hey Copilot");

Once started, the service:

  1. Continuously listens for the wake word phrase
  2. When detected, captures the user’s utterance via speech-to-text
  3. Sends the utterance to the AI via TalkTo()
  4. Loops back to listening for the wake word
aiService.StopWakeWord();

This cancels the background listening loop and returns the service to an idle state. The WakeWord property is cleared and IsWakeWordEnabled returns to false.

if (aiService.IsWakeWordEnabled)
{
Console.WriteLine($"Listening for: {aiService.WakeWord}");
}
  • Only one wake word at a time — calling StartWakeWord() while already active throws InvalidOperationException
  • Exclusive with ListenAndTalkListenAndTalk() throws InvalidOperationException if wake word is active (they both use the microphone)
  • Waits for in-progress workStartWakeWord() waits for any active TalkTo() call to complete before starting the listener
async Task ToggleWakeWord()
{
if (aiService.IsWakeWordEnabled)
{
aiService.StopWakeWord();
}
else
{
await aiService.StartWakeWord("Hey Copilot");
}
}

Wake word detection is powered by Shiny.Speech’s ISpeechToTextService. The service calls ListenForKeyword() to detect the wake phrase, then ListenUntilSilence() to capture the user’s command. Both are platform-native implementations — no cloud API is needed for the wake word detection itself.