mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-19 04:17:44 +00:00
Send stop-playback event (#1186)
* Send stop-playback event https://github.com/jambonz/jambonz-feature-server/issues/1185 * check if not notified in playback-stop, ensure that the stop-playback is sent when kill-playback is sent
This commit is contained in:
@@ -223,6 +223,8 @@ class TaskSay extends TtsTask {
|
||||
});
|
||||
ep.once('playback-stop', (evt) => {
|
||||
this.logger.debug({evt}, 'Say got playback-stop');
|
||||
this.notifyStatus({event: 'stop-playback'});
|
||||
this.notifiedPlayBackStop = true;
|
||||
const tts_error = evt.variable_tts_error;
|
||||
let response_code = 200;
|
||||
// Check if any property ends with _response_code
|
||||
@@ -307,6 +309,9 @@ class TaskSay extends TtsTask {
|
||||
this.logger.debug('TaskSay:kill - clearing TTS stream for streaming audio');
|
||||
cs.clearTtsStream();
|
||||
} else {
|
||||
if (!this.notifiedPlayBackStop) {
|
||||
this.notifyStatus({event: 'stop-playback'});
|
||||
}
|
||||
this.notifyStatus({event: 'kill-playback'});
|
||||
this.ep.api('uuid_break', this.ep.uuid);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user