* fix for #1285

* typo
This commit is contained in:
Dave Horton
2025-07-15 11:38:48 -04:00
committed by GitHub
parent 62b6a814b7
commit 2a42ccb0e1

View File

@@ -278,7 +278,13 @@ class TaskSay extends TtsTask {
try {
this.logger.debug({evt},
`Say got playback-stop ${evt.variable_tts_playback_id ? evt.variable_tts_playback_id : ''}`);
const unmatchedResponse = !!evt.variable_tts_playback_id && evt.variable_tts_playback_id !== playbackId;
/**
* If we got a playback id on both the start and stop events, and they don't match,
* then we must have received a playback-stop event for an earlier play request.
*/
const unmatchedResponse = (!!playbackId && !!evt.variable_tts_playback_id) &&
evt.variable_tts_playback_id !== playbackId;
if (unmatchedResponse) {
this.logger.info({currentPlaybackId: playbackId, stopPPlaybackId: evt.variable_tts_playback_id},
'Say:exec discarding playback-stop for earlier play');