support say stream with text (#1227)

* support say stream with text

* wip

* wip

* wip

* wip

* update verb  specification
This commit is contained in:
Hoan Luu Huu
2025-06-10 21:56:44 +07:00
committed by GitHub
parent 29708a1f7c
commit b0b74871e7
5 changed files with 103 additions and 19 deletions

View File

@@ -220,6 +220,18 @@ class CallSession extends Emitter {
this._synthesizer = synth;
}
/**
* Say stream enabled
*/
get autoStreamTts() {
return this._autoStreamTts || false;
}
set autoStreamTts(i) {
this._autoStreamTts = i;
}
/**
* ASR TTS fallback
*/
@@ -1799,6 +1811,10 @@ Duration=${duration} `
.catch((err) => this.logger.debug({err}, 'CallSession:_notifyTaskStatus - Error sending'));
}
async _internalTtsStreamingBufferTokens(tokens) {
return await this.ttsStreamingBuffer?.bufferTokens(tokens) || {status: 'failed', reason: 'no tts streaming buffer'};
}
_lccTtsFlush(opts) {
this.ttsStreamingBuffer?.flush(opts);
}