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

Resemble AI

Text-to-speech with Resemble AI: ResembleAITTSService streams audio and word timestamps over WebSocket.

Overview

ResembleAITTSService keeps one WebSocket open to Resemble AI's streaming endpoint and sends each sentence as a JSON request. Audio comes back as base64 JSON frames, which the service buffers (a one-second jitter buffer first, then 2208-byte frames) so playback survives Resemble's bursty delivery.

Installation

bun add @pipedog/resembleai
import { ResembleAITTSService } from "@pipedog/resembleai/tts";

Prerequisites

  • A Resemble AI account on a plan that includes the WebSocket API, an API key, and the UUID of a voice.
  • Pass the key as apiKey. The examples read it from RESEMBLE_API_KEY.

Configuration

Prop

Type

Settings

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

SettingTypeDefaultDescription
voicestring | nullnullUUID of the voice (voice_uuid).
modelstring | nullnullNot used.
languageLanguage | nullnullNot used.

Usage

tts.ts
import { ResembleAITTSService } from "@pipedog/resembleai/tts";

const tts = new ResembleAITTSService({
  apiKey: process.env.RESEMBLE_API_KEY ?? "",
  // Resemble's WebSocket reference lists the project as required.
  projectUuid: process.env.RESEMBLE_PROJECT_UUID ?? null,
  settings: new ResembleAITTSService.Settings({ voice: "your-voice-uuid" }),
});

Event handlers

EventDescription
on_connectedThe WebSocket connected.
on_disconnectedThe WebSocket closed.
on_connection_errorThe connection failed.

Notes

  • The sample rate defaults to 22050 Hz (8000, 16000, 22050, 32000 and 44100 work), precision to PCM_16 and outputFormat to wav. Audio is requested without a WAV header.
  • Word timestamps come from Resemble's per-character timings, so each pushed "word" is one character.
  • A 401 or 403 error from Resemble closes the connection and opens a new one.
  • Resemble doesn't acknowledge the WebSocket closing handshake, so the service doesn't wait for one.
  • projectUuid is not an upstream option. Resemble's reference lists project_uuid as required, but upstream never sends it, so the service sends it only when you set it.

Runtime notes

  • The WebSocket opens through the core websocketConnect, with the key in an Authorization header (through fetch on Cloudflare Workers), so it works on Bun, Node, Deno and Cloudflare Workers.
  • The deprecated voiceId option is not ported. Use settings.
  • Tested against a local WebSocket server, not against Resemble AI itself.
RuntimeWorksWhat it needs
Bun✅ yesNothing.
Node.js✅ yesNothing.
Deno✅ yesNothing.
Cloudflare Workers✅ yesNothing.

Generated from pipecat.runtimes and pipecat.compat in packages/resembleai/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