Updated
Integrate Google TTS with the Conversational AI Engine.
Google provides fast, reliable text-to-speech (TTS) with customizable voices.
Sample configuration
The following examples show how to configure Google TTS when starting a conversational AI agent.
from agora_agent import Agent
from agora_agent.agentkit.vendors import GoogleTTS
# client is your configured Agora client
agent = (
Agent(client)
.with_stt(...) # configure your STT vendor
.with_llm(...) # configure your LLM vendor
.with_tts(GoogleTTS(
key='<google_application_credentials_string>',
voice_name='en-US-Chirp3-HD-Charon',
))
)import { Agent, GoogleTTS } from 'agora-agents';
// client is your configured Agora client
const agent = new Agent({ client })
.withStt(/* configure your STT vendor */)
.withLlm(/* configure your LLM vendor */)
.withTts(new GoogleTTS({
key: '<google_application_credentials_string>',
voiceName: 'en-US-Chirp3-HD-Charon',
}));import (
"github.com/AgoraIO/agora-agents-go/v2/agentkit"
"github.com/AgoraIO/agora-agents-go/v2/agentkit/vendors"
)
// client is your configured Agora client
agent := agentkit.NewAgent(client).WithStt(/* configure your STT vendor */).
WithLlm(/* configure your LLM vendor */).
WithTts(
vendors.NewGoogleTTS(vendors.GoogleTTSOptions{
Key: "<google_application_credentials_string>",
VoiceName: "en-US-Chirp3-HD-Charon",
}),
)Use the following tts configuration in your request:
"tts": {
"vendor": "google",
"params": {
"credentials": "<GOOGLE_APPLICATION_CREDENTIALS_STRING>",
"VoiceSelectionParams": {
"name": "en-US-Chirp3-HD-Charon"
},
"AudioConfig": {
"speaking_rate": 1.0,
"sample_rate_hertz": 24000
}
}
}Key parameters
| Parameter | Description |
|---|---|
credentialsstring | The Google Cloud service account credentials JSON string used for authentication. Get your credentials from the Google Cloud Console. |
VoiceSelectionParamsobject |
|
AudioConfigobject |
|
Caution
The parameters listed on this page are validated for use with Conversational AI Engine. Required parameters must be provided as documented. Any additional parameters are passed through directly to the underlying vendor without validation. For a full list of supported options, refer to the Google documentation.
This integration is fully supported for use with Conversational AI Engine. While it has completed functional validation, it is newer to the platform, and additional provider-specific edge cases may be identified as usage scales across a broader range of applications and workloads.
