13ty's profile picture
13ty

vibevoice-tts

Public

104 Downloads

README

vibevoice-tts

LM Studio plugin that prepares clean, structured text for the VibeVoice TTS engine. Does NOT generate audio — formats text for optimal speech output.

Overview

VibeVoice TTS has no SSML support. This plugin provides two tools:

  • format — Basic text cleaning + multi-speaker script formatting
  • prepare — Full podcast script preparation pipeline with pause markers, chunking, and TTS recommendations

Tools

ToolDescription
formatClean and format text for VibeVoice TTS with multi-speaker support, emotion mapping, and JSON input
prepareFull podcast preparation: abbreviation expansion, pause markers, direction tags, paragraph splitting, script chunking, TTS recommendations

Features

format Tool

  • Text cleaning pipeline — strips smart quotes, Chinese quotes, emoji, HTML/XML tags, URLs, non-speech annotations, excess whitespace
  • Multi-speaker detection — parses Speaker N: or S1: prefixes; falls back to single-speaker mode
  • PsiPi emotion method — inline [emotion]/(emotion) annotations route lines to mapped speaker slots; tags are stripped from output
  • Default emotion map — neutral/calm to 1, happy/sad to 2, angry/excited to 3
  • Expanded emotion labels — thoughtful, whisper, serious, energetic, warm, cold, mysterious, dramatic
  • JSON input — accepts [{ "speaker": 1, "text": "..." }] for structured data
  • Output formats — plain (cleaned text), script (Speaker N: format), json (structured array)

prepare Tool (Podcast Pipeline)

  • Abbreviation expansion — e.g. becomes for example, AI becomes A I (first occurrence only)
  • Direction tag extraction — [emphasis], [slower], [faster], [whisper], [louder], [softer] extracted as metadata hints
  • Pause marker conversion — [pause 1s] becomes empty lines (VibeVoice interprets empty lines as natural pauses)
  • Paragraph splitting — long paragraphs split into 2-3 sentence chunks for better TTS quality
  • Script chunking — ~500 words per chunk for optimal VibeVoice generation quality
  • TTS recommendations — temperature, speed, WPM metadata based on script analysis

Podcast Workflow

For broadcast-quality podcast production with VibeVoice:

Step 1: Prepare the Script

{
  "tool": "prepare",
  "params": {
    "text": "Your full podcast script here...\n\nSpeaker 1: Welcome to the show.\n\n[pause 1s]\n\nSpeaker 2: Today we're discussing AI.",
    "chunkSize": 500,
    "paragraphPauses": true,
    "sentencePauses": false,
    "maxSentencesPerParagraph": 3,
    "expandAbbreviations": true,
    "preserveDirections": true,
    "output": "script"
  }
}

Step 2: Generate Each Chunk Separately

The prepare tool returns chunks of ~500 words each. Generate audio for each chunk separately to avoid quality degradation on long inputs.

Step 3: Post-Process

  • Concatenate chunks with 200ms crossfade to eliminate seam artifacts
  • Apply gentle compression (ratio 2:1, threshold -18dB) to even out volume
  • Add a high-pass filter at 80Hz to remove rumble
  • Add intro jingle (under 10 seconds), background music at -20dB under speech

Step 4: Publish

  • Export as 128kbps MP3 for podcast platforms
  • Include ID3 tags with episode title, number, and description
  • Upload to RSS-based podcast host (Buzzsprout, Anchor, Podbean)

Pause Markers

VibeVoice interprets empty lines as natural pauses. The prepare tool converts explicit pause markers:

MarkerUse Case
[pause 0.3s]Between sentences
[pause 0.5s]Between paragraphs
[pause 1s]Between sections

Example input:

Speaker 1: Welcome to the show.[pause 0.5s]

Speaker 2: Today we're discussing AI.[pause 1s]

Speaker 1: Let's begin.

Direction Tags

Direction tags are metadata hints — NOT sent to VibeVoice. They guide the human operator on TTS parameter adjustments:

TagSuggested Adjustment
[emphasis]Slightly increase volume or speed
[slower]Reduce speed to 0.85x
[faster]Increase speed to 1.05x
[whisper]Use whisper voice reference
[louder]Increase volume
[softer]Decrease volume

Example:

Speaker 1: [emphasis]This is the most important point of the episode.
Speaker 2: [slower]Let me explain this carefully...

TTS Recommendations

The prepare tool returns recommendations based on script analysis:

Content TypeTemperatureSpeedWPM
Narration0.6-0.70.95x155
Dialogue/Storytelling0.8-0.90.95x160

Emotion Control

VibeVoice controls emotion through voice reference audio clips assigned to speaker slots — never through inline tags.

[calm] The evening was quiet.
[happy] What a wonderful surprise!
[angry] This is unacceptable!

Becomes:

Speaker 1: The evening was quiet.
Speaker 2: What a wonderful surprise!
Speaker 3: This is unacceptable!

Assign the same voice to slots 1-3 with different emotional reference clips for dynamic emotion.

Available Emotion Labels

neutral, happy, sad, angry, excited, calm, thoughtful, whisper, serious, energetic, warm, cold, mysterious, dramatic

Usage

format Tool

{
  "tool": "format",
  "params": {
    "text": "[happy] Hello world!",
    "mode": "auto",
    "speakers": 3,
    "voices": ["Alice", "Bob", "Charlie"],
    "emotions": ["calm", "happy", "angry"],
    "clean": true,
    "output": "script",
    "emotion_map": { "happy": 2, "angry": 3 }
  }
}

prepare Tool

{
  "tool": "prepare",
  "params": {
    "text": "Speaker 1: Welcome to today's episode about AI.\n\n[pause 0.5s]\n\nSpeaker 2: [thoughtful]I've been thinking about this for a while...",
    "chunkSize": 500,
    "paragraphPauses": true,
    "sentencePauses": true,
    "maxSentencesPerParagraph": 3,
    "expandAbbreviations": true,
    "preserveDirections": true,
    "output": "script"
  }
}

Abbreviation Expansion

Common abbreviations are expanded on first use for TTS clarity:

AbbreviationExpansion
e.g.for example
i.e.that is
etc.et cetera
vs.versus
Mr.Mister
Dr.Doctor
AIA I
TTStext to speech
APIA P I
URLU R L
JSONjay son

Development

npm install
npm run build
lms dev

Schema

  • schemas/formatting.schema.json — Schema for the format tool
  • schemas/prepare.schema.json — Schema for the prepare tool