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.
Starting Wake Word
Section titled “Starting Wake Word”await aiService.StartWakeWord("Hey Copilot");Once started, the service:
- Continuously listens for the wake word phrase
- When detected, captures the user’s utterance via speech-to-text
- Sends the utterance to the AI via
TalkTo() - Loops back to listening for the wake word
Stopping Wake Word
Section titled “Stopping 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.
Checking State
Section titled “Checking State”if (aiService.IsWakeWordEnabled){ Console.WriteLine($"Listening for: {aiService.WakeWord}");}Constraints
Section titled “Constraints”- Only one wake word at a time — calling
StartWakeWord()while already active throwsInvalidOperationException - Exclusive with ListenAndTalk —
ListenAndTalk()throwsInvalidOperationExceptionif wake word is active (they both use the microphone) - Waits for in-progress work —
StartWakeWord()waits for any activeTalkTo()call to complete before starting the listener
Example: Settings Toggle
Section titled “Example: Settings Toggle”async Task ToggleWakeWord(){ if (aiService.IsWakeWordEnabled) { aiService.StopWakeWord(); } else { await aiService.StartWakeWord("Hey Copilot"); }}How It Works
Section titled “How It Works”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.