Revert change on wordOffset

This commit is contained in:
Hongbo Wu 2022-09-08 16:19:12 +08:00
parent 85e39dc9f1
commit 2eb6255ff3

View file

@ -51,7 +51,7 @@ export const synthesizeTextToSpeech = async (
const synthesizer = new SpeechSynthesizer(speechConfig)
const speechMarks: SpeechMark[] = []
let timeOffset = 0
const wordOffset = 0
let wordOffset = 0
synthesizer.synthesizing = function (s, e) {
// convert arrayBuffer to stream and write to stream
@ -149,6 +149,7 @@ export const synthesizeTextToSpeech = async (
}
// for utterance, just assemble the ssml and pass it through
const start = startSsml(ssmlOptions)
wordOffset = -start.length
const ssml = `${start}${input.text}${endSsml()}`
const result = await speakSsmlAsyncPromise(ssml)
return {