Skip to content

feat(tts): add gandr_tts extension - #2300

Open
AALG123 wants to merge 1 commit into
TEN-framework:mainfrom
AALG123:add-gandr-tts
Open

feat(tts): add gandr_tts extension#2300
AALG123 wants to merge 1 commit into
TEN-framework:mainfrom
AALG123:add-gandr-tts

Conversation

@AALG123

@AALG123 AALG123 commented Aug 30, 2026

Copy link
Copy Markdown

What

Adds gandr_tts, a TTS extension for Gandr (https://gandr.ai), under ai_agents/agents/ten_packages/extension/gandr_tts/.

Gandr exposes an OpenAI compatible speech endpoint, so the extension is a close mirror of the in tree rime_http_tts pattern: it extends AsyncTTS2HttpExtension from ten_ai_base and streams audio over a plain HTTP POST with httpx.

How it works

  • POST https://tts.gandr.ai/v1/audio/speech with a Bearer API key and a JSON body of model, input, voice, response_format
  • response_format is forced to pcm; the service streams s16le mono 24000 Hz and synthesize_audio_sample_rate() reports a fixed 24000
  • Properties under params: api_key (defaults to the GANDR_TTS_API_KEY env var), voice (default gandr-mia), model (default tts-1), optional endpoint override
  • Cancel/flush handling, error mapping (401 to INVALID_KEY_ERROR), dump support, and TTFB metadata follow the rime_http_tts implementation line for line

Gandr serves six voices (gandr-mia, gandr-ava, gandr-jenny, gandr-dane, gandr-leo, gandr-lewis) across 23 languages, and every render is watermarked. Keys are available at https://gandr.ai with a free tier of 50,000 tokens, so smoke testing against the live endpoint is straightforward.

Testing

  • tests/ mirrors the rime_http_tts suite (basic dump/flush, error messages, TTFB metrics, params passthrough, robustness, state machine) adapted to the Gandr config surface; all vendor calls in these tests are mocked
  • This was written against the in tree extension contracts and the Gandr API docs; I have not yet exercised it inside a full TEN graph, so I would appreciate a run of your extension test harness on this PR. Happy to iterate on review feedback and to sign the CLA.

Disclosure: I work on Gandr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant