lively-coat-10905
10/24/2025, 9:33 AMtall-airline-16756
10/24/2025, 9:33 AMtall-airline-16756
10/24/2025, 9:34 AMSTT class from livekit.plugins.google. Here's a simple example to guide you:
`from livekit.plugins.google import STT
stt_plugin = STT(
languages="en-US",
interim_results=True,
punctuate=True,
model="latest_long"
)`Just customize the parameters as needed for your project.
4. Real-Time Streaming: To get real-time transcription going, create a speech stream like this:
`stream = stt_plugin.stream()`You'll want to handle events such as START_OF_SPEECH, INTERIM_TRANSCRIPT, and FINAL_TRANSCRIPT to process the audio live. It’s really powerful once set up!
5. Integration with LiveKit Agents: Finally, you can use the STT plugin within an agent session to process audio and handle transcription events seamlessly. Here's an example to illustrate:
`from livekit.agents import AgentSession, stt
async def entrypoint(ctx: AgentSession):
google_stt = STT(languages="en-US", interim_results=True, punctuate=True, model="latest_long")
await ctx.connect()
stt_stream = google_stt.stream()
async for event in stt_stream:
if event.type == stt.SpeechEventType.FINAL_TRANSCRIPT:
print(f"User said: {event.alternatives[0].text}")`Feel free to adapt this to your needs!
If you want to dive deeper or need more examples, the Google Cloud STT Plugin Guide is a fantastic resource. And remember, I’m here to help if you have any questions along the way!
Sources: livekit-plugins/livekit-plugins-clova/README.md | Google Cloud STT plugin guide | LiveKit Docs | Google AI and LiveKit | LiveKit Docs