360 Secure SkillHub
360 安全技能中心

Telnyx Tts

核心功能:调用Telnyx TTS API将文本转换为语音音频,提供Premium级NaturalHD和经济型KokoroTTS两类音色可选,可自定义输出路径。典型场景:制作语音消息、批量生成音频内容等。输入为待转换文本,可通过参数指定输出MP3路径及音色ID;输出为生成的音频文件路径,成功后返回路径,支持用于发送Telegram语音消息。需提前配置TELNYX_API_KEY环境变量。

teamtelnyx
teamtelnyx
热度 70.33
最近更新 2026-05-17 11:45:57
分类:创作依赖:代码执行 / 第三方 API应用场景:文件转换 / API 集成 / 社交媒体

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add telnyx-tts
Metadata
name
telnyx-tts
description
Generate speech audio from text using Telnyx Text-to-Speech API. Use when you need to convert text to spoken audio, create voice messages, or generate audio content.
metadata
{"openclaw":{"emoji":"🔊","requires":{"bins":["python3"],"env":["TELNYX_API_KEY"]},"primaryEnv":"TELNYX_API_KEY"}}

Telnyx Text-to-Speech

Generate high-quality speech audio from text using the Telnyx TTS API.

Usage

To convert text to speech, run the script:

{baseDir}/scripts/telnyx-tts.py "Your text here" -o /tmp/output.mp3

The script outputs the path to the generated audio file on success.

Options

  • -o, --output PATH: Output file path (default: output.mp3)
  • --voice VOICE: Voice ID (default: Telnyx.NaturalHD.astra)

Available Voices

Telnyx provides multiple voice options:

  • Telnyx NaturalHD: Premium voices with refined prosody
    • Telnyx.NaturalHD.astra (default)
    • Telnyx.NaturalHD.luna
    • Telnyx.NaturalHD.andersen_johan
  • Telnyx KokoroTTS: Budget-friendly for high-volume
    • Telnyx.KokoroTTS.af
    • Telnyx.KokoroTTS.am

Example

Generate speech and return as media:

{baseDir}/scripts/telnyx-tts.py "Hello! This is a test of Telnyx text to speech." -o /tmp/tts-output.mp3

Then return the audio file:

MEDIA: /tmp/tts-output.mp3

For Telegram voice notes, the audio will be sent as a voice message.

Environment

Requires TELNYX_API_KEY environment variable to be set.