1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-24 22:22:22 +01:00

[voice_assistant] Use media player callbacks to track TTS response status (#9670)

This commit is contained in:
Kevin Ahrendt
2025-07-18 20:24:55 +01:00
committed by GitHub
parent 3f8494bf8f
commit cb8d9dca2a
2 changed files with 63 additions and 22 deletions

View File

@@ -90,6 +90,15 @@ struct Configuration {
uint32_t max_active_wake_words;
};
#ifdef USE_MEDIA_PLAYER
enum class MediaPlayerResponseState {
IDLE,
URL_SENT,
PLAYING,
FINISHED,
};
#endif
class VoiceAssistant : public Component {
public:
VoiceAssistant();
@@ -272,8 +281,8 @@ class VoiceAssistant : public Component {
media_player::MediaPlayer *media_player_{nullptr};
std::string tts_response_url_{""};
bool started_streaming_tts_{false};
bool media_player_wait_for_announcement_start_{false};
bool media_player_wait_for_announcement_end_{false};
MediaPlayerResponseState media_player_response_state_{MediaPlayerResponseState::IDLE};
#endif
bool local_output_{false};