mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
fix say verb does not close streaming when finish say (#1412)
* fix say verb does not close streaming when finish say * wip * wip * ttsStreamingBuffer reset eventHandlerCount after remove listeners * only send tokens to module if connected * wip * sent stream_open when successfully connected to vendor
This commit is contained in:
@@ -80,7 +80,7 @@ class TtsStreamingBuffer extends Emitter {
|
||||
clearTimeout(this.timer);
|
||||
this.removeCustomEventListeners();
|
||||
if (this.ep) {
|
||||
this._api(this.ep, [this.ep.uuid, 'close'])
|
||||
this._api(this.ep, [this.ep.uuid, 'stop'])
|
||||
.catch((err) =>
|
||||
this.logger.info({ err }, 'TtsStreamingBuffer:stop Error closing TTS streaming')
|
||||
);
|
||||
@@ -193,10 +193,7 @@ class TtsStreamingBuffer extends Emitter {
|
||||
this.logger.debug('TtsStreamingBuffer:_feedQueue TTS stream is not open or no endpoint available');
|
||||
return;
|
||||
}
|
||||
if (
|
||||
this._connectionStatus === TtsStreamingConnectionStatus.NotConnected ||
|
||||
this._connectionStatus === TtsStreamingConnectionStatus.Failed
|
||||
) {
|
||||
if (this._connectionStatus !== TtsStreamingConnectionStatus.Connected) {
|
||||
this.logger.debug('TtsStreamingBuffer:_feedQueue TTS stream is not connected');
|
||||
return;
|
||||
}
|
||||
@@ -365,6 +362,7 @@ class TtsStreamingBuffer extends Emitter {
|
||||
if (this.queue.length > 0) {
|
||||
await this._feedQueue();
|
||||
}
|
||||
this.emit(TtsStreamingEvents.Connected, { vendor });
|
||||
}
|
||||
|
||||
_onConnectFailure(vendor) {
|
||||
@@ -415,6 +413,7 @@ class TtsStreamingBuffer extends Emitter {
|
||||
|
||||
removeCustomEventListeners() {
|
||||
this.eventHandlers.forEach((h) => h.ep.removeCustomEventListener(h.event, h.handler));
|
||||
this.eventHandlers.length = 0;
|
||||
}
|
||||
|
||||
_initHandlers(ep) {
|
||||
|
||||
Reference in New Issue
Block a user