feat fallback speech

This commit is contained in:
Quan HL
2023-08-17 14:28:50 +07:00
parent b1c0478051
commit 5754c386d3
3 changed files with 16 additions and 16 deletions

View File

@@ -235,7 +235,7 @@ class Dialogflow extends Task {
} }
try { try {
const {filePath, servedFromCache} = await this.fallbackSynthAudio(cs, intent, stats); const {filePath, servedFromCache} = await this.fallbackSynthAudio(cs, intent, stats, synthAudio);
if (filePath) cs.trackTmpFile(filePath); if (filePath) cs.trackTmpFile(filePath);
if (!this.ttsCredentials && !servedFromCache) cs.billForTts(intent.fulfillmentText.length); if (!this.ttsCredentials && !servedFromCache) cs.billForTts(intent.fulfillmentText.length);
@@ -281,7 +281,7 @@ class Dialogflow extends Task {
} }
} }
async fallbackSynthAudio(cs, intent, stats) { async fallbackSynthAudio(cs, intent, stats, synthAudio) {
try { try {
const obj = { const obj = {
account_sid: cs.accountSid, account_sid: cs.accountSid,