Skip to content

feat: add MiniMax TTS support#42

Open
Jackisome wants to merge 9 commits into
moeru-ai:mainfrom
Jackisome:feat/minimax-tts
Open

feat: add MiniMax TTS support#42
Jackisome wants to merge 9 commits into
moeru-ai:mainfrom
Jackisome:feat/minimax-tts

Conversation

@Jackisome
Copy link
Copy Markdown

Summary

  • Add MiniMax TTS support to unspeech backend (Go)
  • Support both streaming and non-streaming TTS
  • Add voice list API support via /api/voices?provider=minimax
  • Add TypeScript SDK support via createUnMinimax()
  • Fix Speed field type from int to float64 for better precision

Changes

File Description
pkg/backend/minimax/speech.go TTS implementation with streaming support
pkg/backend/minimax/voices.go Voice list API implementation
pkg/backend/backend.go Add minimax routing
pkg/backend/types/types.go Fix Speed field type (int → float64)
sdk/typescript/src/backend/minimax.ts TypeScript SDK
README.md Add MiniMax to supported providers
sdk/typescript/README.md Add MiniMax documentation

Test Plan

  • Test TTS synthesis (non-streaming)
  • Test streaming TTS
  • Test voice list API (/api/voices?provider=minimax)
  • Test with parameters (speed, emotion, vol, pitch, etc.)

jhandsome and others added 7 commits March 11, 2026 03:10
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the unspeech backend by adding support for MiniMax TTS, offering both streaming and non-streaming capabilities. It includes necessary API endpoints, SDK integration, and a precision fix for the speed parameter, expanding the range of supported TTS providers.

Highlights

  • MiniMax TTS Integration: This PR introduces MiniMax TTS support to the unspeech backend, enabling both streaming and non-streaming TTS functionalities.
  • API and SDK Support: The changes include a voice list API via /api/voices?provider=minimax and TypeScript SDK support through createUnMinimax().
  • Parameter Precision: The Speed field type was updated from int to float64 for improved precision in speech synthesis.
Changelog
  • README.md
    • Updates the README to include MiniMax as a supported provider.
  • pkg/backend/backend.go
    • Integrates MiniMax routing into the existing backend structure.
  • pkg/backend/minimax/speech.go
    • Implements TTS functionality for MiniMax, supporting both streaming and non-streaming modes.
  • pkg/backend/minimax/voices.go
    • Adds a voice list API endpoint specifically for MiniMax.
  • pkg/backend/types/types.go
    • Modifies the Speed field type from int to float64 for better precision.
  • sdk/typescript/README.md
    • Adds documentation for the MiniMax TypeScript SDK.
  • sdk/typescript/src/backend/minimax.ts
    • Creates a TypeScript SDK for MiniMax TTS.
Activity
  • Added MiniMax TTS support to the backend.
  • Implemented streaming and non-streaming TTS.
  • Added voice list API support.
  • Added TypeScript SDK support.
  • Fixed Speed field type for better precision.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for MiniMax TTS to the unSpeech backend and TypeScript SDK. While it introduces new Go backend files for speech synthesis and voice listing, updates to routing, and a corresponding TypeScript SDK module, two medium-severity issues have been identified: a logic bug in the TypeScript SDK causing permanent mutation of the base URL, and a memory exhaustion vulnerability in the streaming TTS implementation due to buffering the entire response. Additionally, the review highlights opportunities to improve code quality by addressing duplication in request building, enhancing readability by replacing nested ternary operators, using idiomatic Go for error and stream handling, and translating Chinese code comments to English for consistency.

Comment thread pkg/backend/minimax/speech.go Outdated
Comment thread sdk/typescript/src/backend/minimax.ts Outdated
Comment thread pkg/backend/minimax/speech.go
Comment thread pkg/backend/minimax/speech.go Outdated
Comment thread pkg/backend/minimax/speech.go Outdated
Comment thread pkg/backend/minimax/speech.go Outdated
Comment thread pkg/backend/minimax/voices.go Outdated
Comment thread pkg/backend/minimax/voices.go Outdated
jhandsome and others added 2 commits March 11, 2026 04:38
- Translate Chinese comments to English
- Extract common functions (buildVoiceSettings, buildAudioSettings, getContentType, handleHTTPError)
- Fix TypeScript baseURL side effect using local variable
- Replace string() conversion with bytes.NewReader
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Jackisome
Copy link
Copy Markdown
Author


本地测试结果 ✅

已使用 TypeScript SDK 在本地完成测试验证:

测试环境

测试结果

  1. 获取语音列表 ✅ - 成功获取 303 个语音
  2. 基本语音合成 ✅ - 111,156 bytes
  3. 带选项语音合成 ✅ - 78,324 bytes (支持 speed/vol/pitch/emotion)

所有测试通过,SDK 可正常使用。

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