diff --git a/.changeset/inworld-remove-trailing-space.md b/.changeset/inworld-remove-trailing-space.md new file mode 100644 index 000000000..4e545b959 --- /dev/null +++ b/.changeset/inworld-remove-trailing-space.md @@ -0,0 +1,5 @@ +--- +'@livekit/agents-plugin-inworld': patch +--- + +Remove additional trailing space to each word from timestamp for proper transcript rendering diff --git a/plugins/inworld/src/tts.ts b/plugins/inworld/src/tts.ts index 28848b95b..659c32397 100644 --- a/plugins/inworld/src/tts.ts +++ b/plugins/inworld/src/tts.ts @@ -585,12 +585,11 @@ class SynthesizeStream extends tts.SynthesizeStream { } // Create TimedString objects for the framework pipeline - // Add trailing space to each word for proper transcript rendering for (let i = 0; i < words.length; i++) { if (words[i] !== undefined && starts[i] !== undefined && ends[i] !== undefined) { pendingTimedTranscripts.push( createTimedString({ - text: words[i] + ' ', + text: words[i]!, startTime: starts[i], endTime: ends[i], }),