This commit is contained in:
Dave Horton
2025-08-20 15:15:56 -04:00
parent ea954eca0b
commit 10b5ceeef1
2 changed files with 16 additions and 10 deletions

View File

@@ -267,10 +267,8 @@ class TaskSay extends TtsTask {
const isStreaming = filepath[segment].startsWith('say:{');
if (isStreaming) {
const arr = /^say:\{.*\}\s*(.*)$/.exec(filepath[segment]);
if (arr) this.logger.debug(`Say:exec sending streaming tts request: ${arr[1].substring(0, 64)}..`);
}
else {
this.logger.debug(`Say:exec sending ${filepath[segment].substring(0, 64)}`);
if (arr) this.logger.debug(`Say:exec sending streaming tts request ${arr[1].substring(0, 64)}..`);
else this.logger.debug(`Say:exec sending ${filepath[segment].substring(0, 64)}`);
}
const onPlaybackStop = (evt) => {
@@ -282,10 +280,11 @@ class TaskSay extends TtsTask {
* 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 playbackId = this.getPlaybackId(segment);
// eslint-disable-next-line max-len
const unmatchedResponse = (!!this.playbackId && !!evt.variable_tts_playback_id) && evt.variable_tts_playback_id !== this.playbackId;
const unmatchedResponse = (!!playbackId && !!evt.variable_tts_playback_id) && evt.variable_tts_playback_id !== playbackId;
if (unmatchedResponse) {
this.logger.info({currentPlaybackId: this.playbackId, stopPlaybackId: evt.variable_tts_playback_id},
this.logger.info({currentPlaybackId: playbackId, stopPlaybackId: evt.variable_tts_playback_id},
'Say:exec discarding playback-stop for earlier play');
ep.once('playback-stop', this._boundOnPlaybackStop);
@@ -359,10 +358,11 @@ class TaskSay extends TtsTask {
const onPlaybackStart = (evt) => {
try {
const playbackId = this.getPlaybackId(segment);
// eslint-disable-next-line max-len
const unmatchedResponse = (!!this.playbackId && !!evt.variable_tts_playback_id) && evt.variable_tts_playback_id !== this.playbackId;
const unmatchedResponse = (!!playbackId && !!evt.variable_tts_playback_id) && evt.variable_tts_playback_id !== playbackId;
if (unmatchedResponse) {
this.logger.info({currentPlaybackId: this.playbackId, stopPlaybackId: evt.variable_tts_playback_id},
this.logger.info({currentPlaybackId: playbackId, stopPlaybackId: evt.variable_tts_playback_id},
'Say:exec playback-start - unmatched playback_id');
ep.once('playback-start', this._boundOnPlaybackStart);
return;