We are using this in frontend to get the transcrip...
# ask-ai
d
We are using this in frontend to get the transcription
Copy code
room.registerTextStreamHandler('lk.transcription', async (reader, participantInfo) => {
  const message = await reader.readAll();
  if (reader.info.attributes['lk.transcribed_track_id']) {
    console.log(`New transcription from ${participantInfo.identity}: ${message}`);
  } else {
    console.log(`New message from ${participantInfo.identity}: ${message}`);
  }
});
The user speech is streamed which is as expected. But agent speech text comes into this only after the speech is done. Not in a streaming way
t
Thanks for reaching out, Avadhootha. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thank you for sharing the code snippet and describing the issue. The behavior you're observing, where the agent's speech text is only received after the speech is completed, could be influenced by the configuration of the transcription system. Specifically, the following parameters might be relevant: • max_delay: This controls the delay in seconds between the end of a spoken word and returning the final transcript results. The default value is 0.7 seconds. • max_delay_mode: If set to
flexible
, the final transcript is delayed until proper numeral formatting is complete. These settings can affect how quickly the transcription is streamed. You may want to review and adjust these parameters in your transcription configuration to achieve the desired streaming behavior for the agent's speech. If you need further assistance or have additional questions, feel free to let me know! Sources: Speechmatics integration guide | LiveKit Docs | GitHub::LiveKit Agents | livekit-agents/livekit/agents/voice/transcription/... | Speechmatics STT integration guide | LiveKit Docs