MCPcopy
hub / github.com/TanStack/ai / updateLevels

Function updateLevels

packages/ai-react/src/use-realtime-chat.ts:157–163  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

155 // Audio level animation loop
156 useEffect(() => {
157 function updateLevels() {
158 if (clientRef.current?.audio) {
159 setInputLevel(clientRef.current.audio.inputLevel)
160 setOutputLevel(clientRef.current.audio.outputLevel)
161 }
162 animationFrameRef.current = requestAnimationFrame(updateLevels)
163 }
164
165 if (status === 'connected') {
166 updateLevels()

Callers 1

useRealtimeChatFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected