pipedog is an unofficial community port of Pipecat, not affiliated with Daily.
pipedog
Text-to-speech

MiniMax

Text-to-speech with MiniMax's T2A API: MiniMaxHttpTTSService streams PCM audio over HTTP.

Overview

MiniMaxHttpTTSService posts each sentence to MiniMax's T2A (Text-to-Audio) endpoint with streaming on, and pushes the hex-encoded PCM audio of each streamed data: block as it arrives.

Installation

bun add @pipedog/minimax
import { MiniMaxHttpTTSService } from "@pipedog/minimax/tts";

Prerequisites

  • A MiniMax account, an API key and your group id.
  • Pass them as apiKey and groupId. The examples read them from MINIMAX_API_KEY and MINIMAX_GROUP_ID.

Configuration

Prop

Type

Settings

Runtime-updatable settings, passed as settings: new MiniMaxHttpTTSService.Settings({...}) (MiniMaxTTSSettings). Any setting you leave out keeps the default below.

SettingTypeDefaultDescription
modelstring"speech-2.8-turbo"Speech model.
voicestring"Calm_Woman"Voice id.
languageLanguage | nullnullNot sent. Use languageBoost.
speednumber | null1.0Speed, 0.5 to 2.0.
volumenumber | null1.0Volume, above 0 up to 10.
pitchnumber | null0Pitch, -12 to 12.
emotionstring | nullnullEmotional tone: happy, sad, angry, fearful, disgusted, surprised, calm or fluent.
textNormalizationboolean | nullnullText normalization (Chinese and English).
latexReadboolean | nullnullRead LaTeX formulas.
languageBooststring | nullnullA language name to boost, such as English. languageToMinimaxLanguage() maps a Language.

Usage

tts.ts
import { TTSUpdateSettingsFrame } from "@pipedog/core/frames/frames";
import { MiniMaxHttpTTSService } from "@pipedog/minimax/tts";

const tts = new MiniMaxHttpTTSService({
  apiKey: process.env.MINIMAX_API_KEY ?? "",
  groupId: process.env.MINIMAX_GROUP_ID ?? "",
  settings: new MiniMaxHttpTTSService.Settings({
    model: "speech-2.8-turbo",
    voice: "Calm_Woman",
    emotion: "calm",
  }),
});

Change settings mid-call with a TTSUpdateSettingsFrame:

// Queue it on the worker, or push it from a processor upstream of the service.
const update = new TTSUpdateSettingsFrame({
  delta: new MiniMaxHttpTTSService.Settings({ speed: 1.2 }),
});

Notes

  • baseUrl picks the region: https://api.minimax.io/v1/t2a_v2 (global, the default), https://api.minimaxi.chat/v1/t2a_v2 (mainland China) or https://api-uw.minimax.io/v1/t2a_v2 (western United States). The group id is added as ?GroupId=.
  • The last streamed block repeats the whole utterance and carries extra_info. It is skipped, so no audio is played twice.
  • The audio is 16-bit PCM at the pipeline's sample rate, one channel.
  • MiniMaxTTSSettings.fromMapping() also accepts the older nested voice_setting dict (with vol for volume).

Runtime notes

  • It uses the global fetch, so it works on Bun, Node, Deno and Cloudflare Workers. Pass fetch to use another one (upstream takes an aiohttp session).
  • The deprecated params (InputParams), model and voiceId constructor options are not ported. Use settings.
  • Tested against a local server, not against MiniMax itself.
RuntimeWorksWhat it needs
Bun✅ yesNothing.
Node.js✅ yesNothing.
Deno✅ yesNothing.
Cloudflare Workers✅ yesNothing.

Generated from pipecat.runtimes and pipecat.compat in packages/minimax/package.json: ✅ means the compat smoke test passes on that runtime.

pipedog is an unofficial community TypeScript port of Pipecat. It is not affiliated with or endorsed by Daily or the Pipecat project.

Portions adapted from the Pipecat documentation, Copyright (c) 2024–2025 Daily, BSD-2-Clause (see apps/docs/LICENSE-pipecat-docs).

On this page