How to enable live transcript
# ask-ai
f
How to enable live transcript
t
Thanks for reaching out, Priyanshu. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! If you want to enable live transcription in LiveKit, here’s a simple step-by-step guide to help you get started: 1. Set up an Agent with STT: First, create an
Agent
and choose a speech-to-text (STT) provider you like—OpenAI, Deepgram, or AWS Transcribe all work great. Here’s a quick example:
Copy code
agent = Agent(
    stt=openai.STT()  # or another supported STT provider
)
1. Start an AgentSession: Next, create and start an
AgentSession
with your agent and the room context. Transcription is turned on by default, but here’s how you can be explicit about it:
Copy code
session = AgentSession()
await session.start(
    agent=agent,
    room=ctx.room,
    room_output_options=RoomOutputOptions(
        transcription_enabled=True  # This is actually the default, but good to be clear!
    )
)
1. Real-time transcription forwarding: If you want the transcriptions to stay perfectly in sync with the audio playback, just set
sync_transcription=True
in
RoomOutputOptions
. Like this:
Copy code
room_output_options=RoomOutputOptions(
    transcription_enabled=True,
    sync_transcription=True
)
1. Handle transcription events: To grab the transcription data as it comes in, listen for events like
user_input_transcribed
. Here’s a quick example:
Copy code
@session.on("user_input_transcribed")
def on_transcript(transcript):
    if transcript.is_final:
        print(f"Final transcript: {transcript.transcript}")
1. Frontend integration: On the client side, just subscribe to the
lk.transcription
text stream topic to get those transcriptions and show them live. Also, if you want to see some ready-made examples using different STT providers, check out the LiveKit examples repository. And hey, if you hit any bumps or have questions, just let me know—I’m here to help! Sources: livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/stt.py | Text and transcriptions | LiveKit Docs | complex-agents/teleprompter/cartesia-ink.py | Text and transcriptions | LiveKit Docs | main.py
f
It supports google stt
t
Absolutely! LiveKit does support Google Speech-to-Text (STT) for live transcription through its Google Cloud plugin for LiveKit Agents. Here’s a simple way to get started: 1. Install the plugin: Just run this command to add the Google Cloud plugin:
Copy code
pip install "livekit-agents[google]~=1.2"
1. Provide Google Cloud credentials: You have a few options here: ◦
credentials_info
dictionary ◦
credentials_file
JSON file ◦ Application Default Credentials 1. Set up the Agent: Here’s a quick example of how to use the Google STT plugin in your agent setup:
Copy code
from livekit_agents.google import GoogleSTT

agent = Agent(
    stt=GoogleSTT(credentials_file="path/to/your/credentials.json")
)
1. Start an AgentSession: Create and start an
AgentSession
with transcription enabled, just like we talked about earlier. Google STT supports over 125 languages, streaming recognition, interim results, and final transcripts with confidence scores. If you have any questions or need a hand with anything else, just let me know—I’m here to help! Sources: Google AI and LiveKit | LiveKit Docs | Live Conversations with AI using ChatGPT and WebRTC | livekit-plugins/livekit-plugins-google/livekit/plugins/google/__init__.py | Google integration guide | LiveKit Docs | Google Cloud STT integration guide | LiveKit Docs
f
is agent avilable for nodejs ?
t
Absolutely, LiveKit Agent is available for Node.js! The LiveKit Agents for Node.js framework lets you create real-time, programmable participants that run right on your servers. It’s designed to build conversational, multimodal voice agents that can see, hear, and understand—pretty cool, right? Right now, the Node.js version is in beta but already supports the core features you’ll need, including plugins for speech-to-text (STT), text-to-speech (TTS), and large language models (LLMs) from providers like OpenAI, Deepgram, and ElevenLabs. To get started, just install the core Agents library with this command:
Copy code
pnpm install @livekit/agents
You can add more plugins whenever you need them. If you have any questions or want a hand with anything, just let me know—I’m here to help! Sources: agents/package.json | LiveKit Agents | Agents Overview | LiveKit Docs
f
Hello! I have a working real-time transcription service using a Node.js backend and the
RoomCompositeEgress
RTMP streaming method. It works, but I want to migrate to the more efficient and modern LiveKit Agents architecture as recommended in your docs. My goal is to replace my entire Node.js-based audio processing pipeline (
node-media-server
and
ffmpeg
) with a dedicated Nodejs Agent. I need a complete, step-by-step guide and best practices for this migration.
t
Hey there! If you're looking to switch from RoomCompositeEgress RTMP streaming to the LiveKit Agents setup for real-time transcription using Node.js, here’s a friendly step-by-step to help you out: 1. Stop using RoomCompositeEgress: It mixes audio into a video stream, which isn’t great for real-time transcription, so it’s best to move away from it. 2. Get LiveKit Agents ready: First, install the
@livekit/agents
SDK in your Node.js backend like this:
Copy code
pnpm install @livekit/agents
1. Create your Node.js Agent: Build an agent that joins a LiveKit room as a hidden participant. This agent will subscribe to audio tracks and handle them in real time. Here’s a quick example:
Copy code
const { Agent, AudioStream } = require('@livekit/agents');

const agent = new Agent({
  stt: new YourSTTPlugin(), // Swap this out with your preferred STT plugin (like Google, Deepgram, etc.)
});

agent.on('trackSubscribed', (track) => {
  const audioStream = new AudioStream(track);
  audioStream.pipe(agent.stt.stream());
});
1. Handle the transcriptions: Use your STT plugin to process the audio frames and send the transcription results back as data messages in the room. 2. Update your frontend: Make sure your frontend listens for those transcription data messages from the LiveKit room and shows them live. This way, you get real-time, low-latency transcription by working directly with the individual audio tracks. If you want me to walk you through any part or share more examples, just give me a shout! Sources: Transcription Applications | livekit/livekit_composite | DeepWiki | agents/src/pipeline/pipeline_agent.ts | Universal Egress | Transcription Applications | livekit/livekit_composite | DeepWiki
t
Hey there! That error message, "WebSocket connection failed: HTTP Authentication failed; no valid credentials available," usually means there’s a hiccup with the access token used for authentication. Here’s a quick checklist to help you sort it out: 1. Double-check the Access Token: Make sure your token is created using your API key and secret, and that it includes: ◦ Participant identity ◦ Room name ◦ All the necessary permissions ◦ A valid expiration time 1. Look at How the Token’s Used: Confirm the token is actually being sent with the connection request. 2. Check if It’s Expired: Tokens have a lifespan, so make sure yours is still valid. 3. Environment Variables: If you’re using LiveKit Agents, ensure your credentials are either passed directly or set up correctly in your environment variables. If you’re still stuck after trying these, just give me a shout—I’m here to help you get this sorted! Sources: lib/src/support/websocket/io.dart | src/api/SignalClient.ts | Authentication | LiveKit Docs | MissingCredentialsError | LiveKit Agents