Skip to content

Add MiniMax Cloud TTS engine (minimax-cloud)#117

Open
octo-patch wants to merge 1 commit into
echogarden-project:mainfrom
octo-patch:feature/minimax-cloud-tts
Open

Add MiniMax Cloud TTS engine (minimax-cloud)#117
octo-patch wants to merge 1 commit into
echogarden-project:mainfrom
octo-patch:feature/minimax-cloud-tts

Conversation

@octo-patch

Copy link
Copy Markdown

Summary

This PR adds MiniMax as a first-class cloud text-to-speech engine (minimax-cloud), joining the existing lineup of Google Cloud, Azure, Amazon Polly, OpenAI Cloud, ElevenLabs, and Deepgram.

What's included

  • src/synthesis/MiniMaxCloudTTS.ts — new engine module:

    • Calls POST https://api.minimax.io/v1/t2a_v2 (non-streaming, returns hex-encoded MP3)
    • Supports speech-2.8-hd (default) and speech-2.8-turbo models
    • 12 verified voice IDs (English and bilingual English/Chinese)
    • Speed clamped to [0.5, 2.0] as required by the API
    • API key via miniMaxCloud.apiKey option or MINIMAX_API_KEY environment variable
  • src/api/Synthesis.ts — integrated into the synthesis pipeline:

    • 'minimax-cloud' added to SynthesisEngine union type
    • miniMaxCloud?: MiniMaxCloudTTSOptions in SynthesisOptions
    • Synthesis dispatch (case 'minimax-cloud')
    • Voice list dispatch
    • synthesisEngines metadata entry
  • src/tests/MiniMaxCloudTTS.test.ts — 13 unit tests using Node.js built-in node:test:

    • Voice list structure validation
    • Default option values
    • TypeScript interface compliance
    • Error handling (missing API key)
    • Engine registration in synthesisEngines
    • All tests pass without a network call or API key
  • docs/Engines.md and README.md — documentation updated

Usage

import * as API from 'echogarden'

const result = await API.synthesize('Hello from MiniMax!', {
  engine: 'minimax-cloud',
  miniMaxCloud: {
    apiKey: process.env.MINIMAX_API_KEY,
    model: 'speech-2.8-hd',
  },
  voice: 'English_Graceful_Lady',
  language: 'en-US',
})

Or set MINIMAX_API_KEY in the environment and omit apiKey.

Available voices

Voice ID Language(s) Gender
English_Graceful_Lady en female
English_Insightful_Speaker en male
English_radiant_girl en female
English_Persuasive_Man en male
English_Lucky_Robot en male
Wise_Woman en, zh female
cute_boy en, zh male
lovely_girl en, zh female
Friendly_Person en, zh unknown
Inspirational_girl en, zh female
Deep_Voice_Man en, zh male
sweet_girl en, zh female

- Add src/synthesis/MiniMaxCloudTTS.ts: synthesize() via POST /v1/t2a_v2,
  12 verified voice IDs, speech-2.8-hd / speech-2.8-turbo models,
  speed clamped to [0.5, 2.0], MINIMAX_API_KEY env var support
- Update src/api/Synthesis.ts: register minimax-cloud in SynthesisEngine
  type, SynthesisOptions, defaultSynthesisOptions, synthesis dispatch
  (case minimax-cloud), voice list dispatch, and synthesisEngines metadata
- Add src/tests/MiniMaxCloudTTS.test.ts: 13 unit tests using node:test
  (voiceList structure, default options, type compliance, error handling,
  engine registration) - no network calls required
- Update docs/Engines.md and README.md to document the new engine
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