Skip to content

feat(speech): add async and WebSocket TTS operations - #223

Open
octo-patch wants to merge 1 commit into
MiniMax-AI:mainfrom
octo-patch:octo/20260804-tts-tool-recvreiL1BRGZG
Open

feat(speech): add async and WebSocket TTS operations#223
octo-patch wants to merge 1 commit into
MiniMax-AI:mainfrom
octo-patch:octo/20260804-tts-tool-recvreiL1BRGZG

Conversation

@octo-patch

@octo-patch octo-patch commented Aug 4, 2026

Copy link
Copy Markdown

Reason: Add the missing async and WebSocket TTS operations to the speech CLI and SDK.

Changes

  • Add mmx speech async — create a long-form async TTS task via POST /v1/t2a_async_v2 (textToAudioAsyncCreate). With --wait it polls until completion and downloads the audio.
  • Add mmx speech task get — query async TTS task status via GET /v1/query/t2a_async_query_v2 (textToAudioAsyncQuery).
  • Add mmx speech websocket — synchronous streaming TTS over WSS /ws/v1/t2a_v2 (textToAudioWebSocket). Supports --out to save the audio and --stream to pipe raw audio chunks to stdout.
  • Add SpeechSDK.createAsync, SpeechSDK.queryAsync, SpeechSDK.downloadAsyncFile, and SpeechSDK.synthesizeWebSocket.
  • Add tests for the SDK async/WebSocket methods and the new CLI commands; document the commands in README, SDK.md, and docs/cli-design.md.

Checks

  • bun run typecheck — pass
  • bun run lint — pass
  • bun test — 460 passing
  • bun run build — pass

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Add the missing MiniMax TTS operations to the speech command and SDK:
- mmx speech async: create a long-form async TTS task (POST /v1/t2a_async_v2)
- mmx speech task get: query async task status (GET /v1/query/t2a_async_query_v2)
- mmx speech websocket: synchronous streaming TTS over WSS (/ws/v1/t2a_v2)
- SpeechSDK: createAsync, queryAsync, downloadAsyncFile, synthesizeWebSocket

The async flow polls the task to completion and downloads the resulting
audio file; the WebSocket flow streams hex-encoded audio chunks as they
arrive and saves or pipes them.
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