Text-to-Speech System: Speech Synthesis with Voice Customization

Text-to-Speech System: Speech Synthesis with Voice Customization

AI Development Areas

Frequently Asked Questions

העבודות האחרונות

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1441
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1301
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    998
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1264
  • image_logo-advance_0.webp
    B2B Advance company logo design
    713
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    1003

Text-to-Speech System: Speech Synthesis with Voice Customization

You launch a voice assistant. The first problem—synthesis latency: if it exceeds 500 ms, users drop the call. The second—an unnatural voice reduces trust. Building a TTS system is not just picking an engine; it's an integration that accounts for latency, cost, and customization. Our engineers have 10+ years of experience in NLP and audio processing, and we have deployed 5 major TTS systems for banks and telecom operators. After customizing XTTS v2 to a host's voice, call retention increased by 22%.

Modern neural synthesizers like Coqui XTTS v2 and ElevenLabs generate speech indistinguishable from human. Latency is 200–500 ms. A self-hosted solution with a custom voice scores 40% higher in MOS than cloud generic synthesis. For volumes exceeding 100,000 generations per month, self-hosted is 30% cheaper than cloud.

How to Choose a TTS Engine for Production

The choice depends on the scenario. For a voice bot, low latency is critical—Azure Speech or Yandex SpeechKit are suitable. For audiobooks and content, maximum quality is needed—Coqui XTTS or ElevenLabs.

Cloud TTS—fast start, predictable quality:

  • OpenAI TTS: best quality in English, good in Russian
  • ElevenLabs: most natural sound, voice cloning
  • Yandex SpeechKit: optimal for Russian-language products

Self-hosted TTS—data control, predictable cost:

  • Coqui XTTS v2: multilingual, cloning from 6 seconds
  • Piper: lightweight, CPU-capable, good quality in Russian
  • Silero TTS: Russian open-source, excellent Russian

Comparison of cloud vs self-hosted:

Parameter Cloud Self-hosted
Latency 100-300 ms 200-500 ms (with GPU)
Cost Per token/second Fixed (GPU)
Data control No Full
Customization Limited Full fine-tuning

What Voice Customization Provides

Standard voices do not fit brands. We perform fine-tuning of a pretrained model on 10–30 minutes of speaker recordings. The result is a unique voice preserving intonations and diction. Such a voice is 40% higher in user MOS than generic synthesis. Example: a voice assistant for a bank after customizing XTTS v2 to a host's voice increased call retention by 22%.

Typical Mistakes in TTS Development

  • Missing text normalization: numbers, dates, abbreviations must be transformed. Without it, numeric amounts sound unnatural.
  • Ignoring pauses and punctuation: TTS without pause insertion sounds unnatural, especially in long sentences.
  • Not considering latency when choosing an engine: for IVR, <200 ms is critical; for audiobooks, 500+ ms is acceptable.
  • Skimping on GPU for self-hosted: without GPU, latency >1 s, unacceptable for interactive scenarios.

How We Build a TTS System: Process

  1. Scenario and requirements analysis—latency measurements, budget, language.
  2. Engine selection and testing—cloud, self-hosted, custom.
  3. API development and integration—FastAPI, task queue (Celery), caching.
  4. Voice customization—data collection, fine-tuning, MOS evaluation.
  5. Load testing—p99 latency, throughput, GPU utilization.
  6. Deployment and monitoring—Docker, Prometheus, Grafana.

Basic Implementation with FastAPI

from fastapi import FastAPI from fastapi.responses import StreamingResponse import io import soundfile as sf from TTS.api import TTS app = FastAPI() tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2") @app.post("/synthesize") async def synthesize(text: str, language: str = "ru"): wav = tts.tts( text=text, language=language, speaker_wav="reference_voice.wav" # для клонирования ) buffer = io.BytesIO() sf.write(buffer, wav, samplerate=24000, format='WAV') buffer.seek(0) return StreamingResponse(buffer, media_type="audio/wav") 

Text Preprocessing

Before feeding to TTS, a normalizer is mandatory: expand abbreviations, numbers, dates:

def normalize_for_tts(text: str, language: str = "ru") -> str: # numbers: e.g., "500" → "five hundred" # abbreviations: "ООО" → "общество с ограниченной ответственностью" # dates: преобразуются по правилам языка ... 

Estimated Timelines

  • Basic cloud TTS integration: from 2 to 3 days
  • Self-hosted with queue and caching: from 1 week
  • Full system with custom voice: from 3 to 4 weeks

Cost is calculated individually after analyzing your scenario.

What's Included

  • Technical architecture documentation
  • Access to the code repository
  • Deployment instructions
  • Team training (1–2 sessions)
  • One month of support after delivery

Experience and Guarantees

5 years in the market, 20+ projects in voice interfaces. We guarantee synthesis stability under loads of up to 10,000 requests/day. Certifications: compatibility with Kubernetes, experience with NVIDIA Triton. Contact us to evaluate your project. Order a TTS system with a custom voice—get a consultation on engines and timelines.

Additional information on technologies can be found on the Speech synthesis Wikipedia page.