From 629f898a36d8961a5872903fa85dc300a6d8f7fa Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Mon, 26 Sep 2022 18:01:03 +0800 Subject: [PATCH] Remove debugging logs --- packages/text-to-speech/src/textToSpeech.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/text-to-speech/src/textToSpeech.ts b/packages/text-to-speech/src/textToSpeech.ts index 1da109085..aa5f39713 100644 --- a/packages/text-to-speech/src/textToSpeech.ts +++ b/packages/text-to-speech/src/textToSpeech.ts @@ -140,12 +140,14 @@ export const synthesizeTextToSpeech = async ( // for ssml let audioData: Buffer = Buffer.from([]) // split ssml into chunks of 2000 characters to stream faster - // both within limit & without breaking on words and bookmarks + // both within limit & without breaking on words and bookmarks const ssmlChunks = input.text.match(/.{1,2000}(?= |$)(?! mark=)/g) if (ssmlChunks) { for (const ssmlChunk of ssmlChunks) { - console.log('ssmlChunk', ssmlChunk) - const ssml = `${startSsml(ssmlOptions)}${ssmlChunk}${endSsml()}` + const startSsmlChunk = startSsml(ssmlOptions) + const ssml = `${startSsmlChunk}${ssmlChunk}${endSsml()}` + // set the text offset to be the end of SSML start tag + wordOffset -= startSsmlChunk.length const result = await speakSsmlAsyncPromise(ssml) if (result.reason === ResultReason.Canceled) { throw new Error(result.errorDetails)