Skip to content

Commit abed63e

Browse files
committed
Update phonemis package & improve streaming in demo app
1 parent be68c30 commit abed63e

File tree

5 files changed

+2
-2
lines changed

5 files changed

+2
-2
lines changed

apps/speech/screens/TextToSpeechLLMScreen.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ export const TextToSpeechLLMScreen = ({ onBack }: TextToSpeechLLMProps) => {
8484
setDisplayText(llm.response);
8585

8686
const previousLength = processedLengthRef.current;
87-
if (llm.response.length > previousLength) {
87+
if (llm.response.length > previousLength && isTtsStreaming) {
8888
const newChunk = llm.response.slice(previousLength);
8989
tts.streamInsert(newChunk);
9090
processedLengthRef.current = llm.response.length;
9191
}
9292
} else {
9393
processedLengthRef.current = 0;
9494
}
95-
}, [llm.response, tts]);
95+
}, [llm.response, tts, isTtsStreaming]);
9696

9797
const handleGenerate = async () => {
9898
setDisplayText('');
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)