mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
wip
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user