if i use the FallbackAdapter, does it for some rea...
# ask-ai
c
if i use the FallbackAdapter, does it for some reason trigger duplicate emitted events to the user_input_transcribed callback? i am noticing the duplicate transmission event only when i add a fallbackadapter, which makes me worry that both stts are being called on each conversational turn instead of the primary stt only.
t
Thanks for reaching out, Faraz. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're right to investigate — here's what's happening and how to troubleshoot. Regarding your main question: the FallbackAdapter does not call both STT providers on every turn. Only the primary STT is used normally; the fallback runs only if the primary fails (API error/timeout) and the request is retried with the next provider. It should not by itself cause duplicate
user_input_transcribed
events. What most commonly causes duplicates: • Multiple listeners accidentally registered for
user_input_transcribed
on the same session. • Client/frontend processing both interim and final transcript messages as separate final results. • An edge-case during a fallback retry where a failed primary produced an event before the fallback result — rare, but possible if your event handling doesn't deduplicate. Troubleshooting steps (quick): 1. Confirm a single listener: search your code for every place you call add/subscribe for
user_input_transcribed
and ensure you only attach once per session. 2. Check interim vs final flags: verify your handler ignores interim transcripts if you only want final results. 3. Reproduce with logging: enable debug logs around transcription events and STT selection; log provider used, request timestamps, and event payload IDs. 4. Correlate failures: when you see a duplicate, check whether the primary returned an error before the fallback returned success (look for STT error events or provider health marks). If you’d like, share: • a short snippet showing how you subscribe to
user_input_transcribed
, and • one example of the duplicate event payloads (timestamps / interim/final flags / provider info if present). I can then point out exactly where duplicates are likely introduced and suggest precise code fixes. Sources: Events and error handling | LiveKit docs | Text and transcriptions | LiveKit docs