| | |
| | | */ |
| | | void StopListening(); |
| | | void SendListenDetect(const std::string& text, bool open_if_idle = true); |
| | | bool SendListenDetectNow(const std::string& text); |
| | | |
| | | void Reboot(); |
| | | void WakeWordInvoke(const std::string& wake_word); |
| | |
| | | AecMode GetAecMode() const { return aec_mode_; } |
| | | void PlaySound(const std::string_view& sound); |
| | | AudioService& GetAudioService() { return audio_service_; } |
| | | void ApplyMp3CommandOnlyMic(); |
| | | void ResumeListeningAfterMp3Clip(); |
| | | void CloseShadowingListenWindow(); |
| | | |
| | | /** |
| | | * Reset protocol resources (thread-safe) |
| | |
| | | bool assets_version_checked_ = false; |
| | | bool local_assets_applied_ = false; |
| | | bool play_popup_on_listening_ = false; // Flag to play popup sound after state changes to listening |
| | | bool skip_playback_wait_on_listen_ = false; |
| | | bool resume_sdcard_mp3_after_tts_ = false; |
| | | bool resume_sdcard_mp3_after_voice_ = false; |
| | | bool sdcard_mp3_stop_requested_ = false; |
| | | bool opening_audio_channel_ = false; |
| | | bool suppress_wake_until_listen_ = false; |
| | | bool network_error_suppressed_ = false; |
| | | std::string pending_detect_text_; |
| | | int pending_detect_retry_ticks_ = 0; |
| | | int pending_detect_retries_left_ = 0; |
| | | int greeting_listen_wait_ticks_ = 0; |
| | | int boot_wake_restore_ticks_ = 0; |
| | | bool tts_audio_expected_ = false; |
| | | bool tts_response_started_ = false; |
| | | bool tts_audio_received_ = false; |
| | |
| | | bool tts_idle_waiting_ = false; |
| | | bool tts_speaking_state_ready_ = false; |
| | | uint32_t tts_activity_generation_ = 0; |
| | | int tts_playback_empty_ticks_ = 0; |
| | | int tts_stop_wait_ticks_ = 0; |
| | | int64_t speaking_started_us_ = 0; |
| | | bool standby_requested_ = false; |
| | | bool power_off_requested_ = false; |
| | | std::atomic_bool power_off_standby_active_{false}; |
| | |
| | | void HandleActivationDoneEvent(); |
| | | void HandleWakeWordDetectedEvent(); |
| | | void ContinueOpenAudioChannel(ListeningMode mode); |
| | | void ContinueOpenAudioChannelForDetect(const std::string& detect_text); |
| | | void ContinueWakeWordInvoke(const std::string& wake_word); |
| | | bool OpenAudioChannelWithRetry(int attempts); |
| | | |
| | | // Activation task (runs in background) |
| | | void ActivationTask(); |
| | |
| | | void ShowActivationCode(const std::string& code, const std::string& message); |
| | | void FinishTtsResponse(); |
| | | void FinishTtsResponseAfterPlayback(); |
| | | void MaybeFinishTtsAfterPlayback(); |
| | | void ScheduleTtsAudio(std::shared_ptr<AudioStreamPacket> packet); |
| | | void ScheduleTtsIdleFallback(); |
| | | void PauseSdCardMp3ForVoice(); |
| | | void ResumeSdCardMp3AfterVoice(); |
| | | void SetListeningMode(ListeningMode mode); |