Telegram TTS Bot

Convert text to speech with customizable parameters using a simple metalanguage

Powered by Chatterbox TTS Server

Project Overview

Project Name

Telegram TTS Bot

Purpose

A Telegram bot that converts text to audio using a local Chatterbox TTS server

Key Feature

Users can specify TTS parameters using a simple metalanguage directly in their messages

Metalanguage Syntax

The metalanguage uses a simple key-value pair format where the main text comes first, followed by parameters using the **PARAM:value format.

Syntax Rules:

  • Main text comes first
  • Parameters are added using **PARAM:value format
  • Multiple parameters can be chained together

Example:

Hello world**CFG:0.8**EXAG:1.2**TMP:1.1

This example sets CFG to 0.8, EXAG to 1.2, and TMP to 1.1

Available Parameters

Parameter Description Default Range
CFG Classifier-free guidance scale 0.5 0.0 - 2.0
EXAG Expression exaggeration 0.4 0.0 - 2.0
TMP Temperature for generation randomness 0.8 0.0 - 1.5
SPD Speed factor for speech tempo 1.0 0.25 - 4.0
LANG Language for text-to-speech generation en en, es, fr, de, it, pt, ru, ja, ko, zh

Predefined Modes

These preset configurations are optimized for different use cases and can be used as starting points for your TTS generation.

Standard Narration

Perfect for educational content and documentaries

Temperature: 0.8
Exaggeration: 0.4
CFG Weight: 0.5
Speed: 1.0
Hello world**CFG:0.5**EXAG:0.4**SPD:1.0**TMP:0.8

Expressive Monologue

Dramatic and theatrical performances

Temperature: 0.75
Exaggeration: 1.1
CFG Weight: 0.6
Speed: 1.0
Hello world**CFG:0.6**EXAG:1.1**SPD:1.0**TMP:0.75

Technical Explanation

Clear and precise technical content

Temperature: 0.85
Exaggeration: 0.4
CFG Weight: 0.5
Speed: 1.0
Hello world**CFG:0.5**EXAG:0.4**SPD:1.0**TMP:0.85

Upbeat Advertisement

Energetic marketing and promotional content

Temperature: 0.8
Exaggeration: 1.3
CFG Weight: 0.45
Speed: 1.0
Hello world**CFG:0.45**EXAG:1.3**SPD:1.0**TMP:0.8

Thoughtful Reflection

Contemplative and philosophical content

Temperature: 0.7
Exaggeration: 0.4
CFG Weight: 0.6
Speed: 1.0
Hello world**CFG:0.6**EXAG:0.4**SPD:1.0**TMP:0.7

Simple Punctuation Test

Basic conversational testing

Temperature: 0.8
Exaggeration: 0.5
CFG Weight: 0.5
Speed: 1.0
Hello world**CFG:0.5**EXAG:0.5**SPD:1.0**TMP:0.8

How It Works

1

User sends message in Telegram

User types text with optional TTS parameters

Hello world**CFG:0.8**TMP:1.2
2

System parses text and parameters

Bot extracts main text and parameter values

3

Request sent to Chatterbox TTS server

Parameters are forwarded to local TTS server

4

Audio generated with specified settings

TTS server processes text with custom parameters

5

Audio returned to user in Telegram

Generated audio file is sent back to the user

Pricing Policy

$1.00 for 2 minutes of speech
Payment via Telegram Stars

Pricing Structure

Our pricing is straightforward and transparent: $1.00 per 2 minutes of generated speech. This rate applies regardless of the language, parameters, or complexity of your text.

Cost = $1.00 per 2 minutes of audio

Payment via Telegram Stars

All purchases are made through Telegram Stars, Telegram's built-in payment system. This provides a secure and convenient way to pay directly within the Telegram app.

Current Exchange Rate: 100 Stars = $2.00
Cost per 2 minutes: 50 Stars = $1.00

Note: The exchange rate may vary. Current rate is approximately 100 stars for $2.00 USD.

Character Estimation

To help you estimate costs, here's a reference guide based on average speech patterns:

Average 2-minute speech ~1,700 characters
Fast speaker (160 wpm) ~2,000+ characters
Slower speaker (100 wpm) ~1,300 characters

Note: Character counts vary based on language, speaking pace, and text complexity. The 1,700 character estimate is based on average French speech patterns at 135 words per minute.

How It Works

1.

Send your text message to the Telegram bot with optional TTS parameters

2.

The system generates audio based on your text length and specified settings

3.

You're charged via Telegram Stars ($1.00 = 50 Stars) for every 2 minutes (or portion thereof) of generated speech

Example Calculation

If you generate a 4-minute speech:

4 minutes ÷ 2 minutes = 2 units
2 units × $1.00 = $2.00 total
$2.00 = 100 Telegram Stars

Technical Setup

N8N

N8N Workflow

Automation platform handling message processing and TTS server communication

TG

Telegram Bot API

Handles user interactions and message delivery in Telegram

TTS

Local TTS Server

Chatterbox TTS server for high-quality text-to-speech generation

Usage Instructions

1

Start a conversation

Send a message to the Telegram bot with your desired text

2

Add parameters (optional)

Use the metalanguage syntax to customize voice settings

Hello there**CFG:0.8**EXAG:1.2**TMP:1.1
3

Receive audio

The bot will generate and send back the audio file with your specified settings