google-cloud-tts

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Google Cloud TTS

Google Cloud TTS

Use this skill when Google Cloud Text-to-Speech is the preferred synthesis provider, particularly within a Google Cloud environment or when the user needs one of Google's Neural2 or WaveNet voices not available through other providers.
Prefer this over OpenAI TTS when the user already uses Google Cloud, needs a specific non-English language voice, or prefers Google's voice catalog.
当你偏好使用Google Cloud Text-to-Speech作为合成服务提供商时,尤其是在Google Cloud环境内,或者需要使用其他提供商不具备的Google Neural2或WaveNet语音时,可以使用此skill。
当用户已在使用Google Cloud、需要特定非英语语言语音,或更青睐Google的语音库时,优先选择此服务而非OpenAI TTS。

Setup

设置

Set
GOOGLE_CLOUD_TTS_CREDENTIALS
in the environment or agent secrets store. Accepts either:
  • An absolute path to a service-account JSON key file
  • A raw JSON string with the service-account credentials
在环境变量或agent密钥存储中设置
GOOGLE_CLOUD_TTS_CREDENTIALS
,支持两种格式:
  • 服务账号JSON密钥文件的绝对路径
  • 包含服务账号凭证的原始JSON字符串

Configuration

配置

json
{
  "voice": {
    "tts": "google-cloud-tts"
  }
}
With voice and language options:
json
{
  "voice": {
    "tts": "google-cloud-tts",
    "providerOptions": {
      "languageCode": "en-GB",
      "voice": "en-GB-Neural2-A"
    }
  }
}
json
{
  "voice": {
    "tts": "google-cloud-tts"
  }
}
带有语音和语言选项的配置:
json
{
  "voice": {
    "tts": "google-cloud-tts",
    "providerOptions": {
      "languageCode": "en-GB",
      "voice": "en-GB-Neural2-A"
    }
  }
}

Provider Rules

提供商规则

  • Output is MP3 (audio/mpeg). Playback requires an MP3-capable audio pipeline.
  • Language codes follow BCP-47 (e.g.
    en-US
    ,
    en-GB
    ,
    de-DE
    ).
  • Call
    listAvailableVoices()
    to enumerate all voices available on the account; useful for letting the user pick a voice.
  • Neural2 and WaveNet voices require the respective API feature to be enabled on the Google Cloud project.
  • 输出格式为MP3(audio/mpeg),播放需要支持MP3的音频处理流程。
  • 语言代码遵循BCP-47标准(例如
    en-US
    en-GB
    de-DE
    )。
  • 调用
    listAvailableVoices()
    可枚举账号下所有可用语音,便于用户选择。
  • 使用Neural2和WaveNet语音需要在Google Cloud项目中启用对应的API功能。

Examples

示例

  • "Use Google Cloud TTS with a British English Neural2 voice."
  • "List the available voices on my Google Cloud TTS account."
  • "Synthesize this response using Google Cloud Text-to-Speech."
  • "使用Google Cloud TTS的英式英语Neural2语音。"
  • "列出我的Google Cloud TTS账号下的可用语音。"
  • "使用Google Cloud Text-to-Speech合成此回复。"

Constraints

限制条件

  • Requires a Google Cloud service account with the
    Text-to-Speech
    API enabled.
  • Credentials must be either a path to a valid JSON key file or inline JSON string.
  • API costs apply per character synthesized.
  • 需要启用
    Text-to-Speech
    API的Google Cloud服务账号。
  • 凭证必须是有效JSON密钥文件的路径或内联JSON字符串。
  • 按合成的字符数收取API费用。