how to use google speech to text on google cloud i...
# ask-ai
r
how to use google speech to text on google cloud in live kit
t
Thanks for reaching out, Av. 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 use Google Speech-to-Text (STT) on Google Cloud with LiveKit, here’s a simple way to get started: 1. Install the LiveKit Google Plugin: Just run
pip install "livekit-agents[google]~=1.2"
to grab the plugin you need. 2. Set Up Authentication: You’ve got a few options to provide your Google Cloud credentials:Don’t forget to enable the Cloud Speech-to-Text API in your Google Cloud project—this step is important! ◦ Pass them directly using the
credentials_info
dictionary. ◦ Save them in a JSON file and set the
GOOGLE_APPLICATION_CREDENTIALS
environment variable. ◦ Or simply use Application Default Credentials (ADC). 1. Configure and Use: Create your Google STT instance within a LiveKit
AgentSession
or run it as a standalone service. Here’s a quick example:
Copy code
from livekit.plugins import google

session = AgentSession(
    stt=google.STT(
        model="chirp",  # The 'chirp' model is great for better accuracy
        spoken_punctuation=False,
    ),
    # You can add other components like LLM, TTS, and more here
)
If you want to dive deeper into configuration options, troubleshoot any hiccups, or explore advanced features, check out the Google ecosystem guide and the Voice AI Quickstart Guide. Happy coding! Sources: Google Cloud STT integration guide | LiveKit Docs | livekit-plugins/livekit-plugins-google/livekit/plugins/google/beta/realtime...