MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / processChunkQueue

Function processChunkQueue

packages/ui/src/views/chatmessage/ChatMessage.jsx:1986–2006  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1984 }
1985
1986 const processChunkQueue = () => {
1987 setTtsStreamingState((prevState) => {
1988 if (!prevState.sourceBuffer || prevState.sourceBuffer.updating || prevState.chunkQueue.length === 0) {
1989 return prevState
1990 }
1991
1992 const chunk = prevState.chunkQueue.shift()
1993
1994 try {
1995 prevState.sourceBuffer.appendBuffer(chunk)
1996 return {
1997 ...prevState,
1998 chunkQueue: [...prevState.chunkQueue],
1999 isBuffering: true
2000 }
2001 } catch (error) {
2002 console.error('Error appending chunk to buffer:', error)
2003 return prevState
2004 }
2005 })
2006 }
2007
2008 const handleTTSStart = (data) => {
2009 setTTSAction(true)

Callers 2

handleTTSDataChunkFunction · 0.85
handleUpdateEndFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected