Skip to content

TTS Research: Alternatives and Commercial Licensing Analysis for Gromozeka #29

Description

@Lewik

TTS Research: Alternatives and Commercial Licensing Analysis for Gromozeka

Research Context

Investigation of TTS options for Gromozeka desktop application focusing on:

  • Commercial licensing compatibility (for potential product sales)
  • Russian language support quality
  • Performance and latency requirements
  • Integration complexity with Kotlin/JVM
  • Cost analysis for desktop chat application usage

Current Implementation Analysis

Existing TTS Setup (Spring AI + OpenAI)

Location: bot/src/jvmMain/kotlin/com/gromozeka/bot/services/TtsService.kt

Current Configuration:

  • Model: gpt-4o-mini-tts (cost-optimized choice)
  • Cost: /bin/zsh.60/1M characters (25x cheaper than tts-1)
  • Voice: OpenAI Alloy voice, MP3 format, 1.0x speed
  • Integration: Well-integrated with chat streaming, TTS queue management, cancellation support
  • Playback: macOS afplay command
  • Monthly cost: < USD for typical usage patterns

Architecture Strengths:

  • Proper queue management with cancellation (TTSQueueService.kt)
  • Integration with streaming chat responses
  • JSON-structured responses from Claude for TTS text extraction
  • Already working and stable

Commercial Licensing Analysis

NOT Commercial Friendly:

  1. macOS native TTS (say command)

    • Apple''s license restricts System Voices to personal, non-commercial use only
    • Excellent Russian voice Milena available
    • Simple integration: say -v Milena текст
    • Use case: Development/prototyping only
  2. Piper TTS

    • License changed: MIT → GPL-3.0 (viral license)
    • Repository moved: rhasspy/piper → github.com/OHF-Voice/piper1-gpl
    • Requires entire application to be open source if used
    • Performance: 20-30ms generation (excellent)
    • Quality: Google TTS level, superior Russian support
  3. eSpeak-NG

    • GPL v3+ license (viral)
    • Russian phonemes available but robotic quality
    • brew install espeak-ng

Commercial Friendly:

  1. Festival TTS (Only viable open-source option)

    • License: BSD-like (allows commercial use)
    • Cost: Free
    • Quality: Basic/robotic sound
    • Russian support: festvox-ru package available
    • Installation: brew install festival + Russian voice package from festvox.org
    • Use case: Offline fallback option
  2. Google Cloud TTS (Recommended cloud option)

    • Free tier: 1M WaveNet characters/month + 4M Standard characters/month
    • Pricing after free tier: /1M WaveNet, /1M Standard
    • Quality: Excellent Russian neural voices (multiple options)
    • Latency: Moderate (API calls)
    • Integration: Java SDK with Kotlin compatibility
  3. Azure TTS

    • Free tier: 500K characters/month
    • Pricing: Similar to Google (~/1M neural voices)
    • Russian voices: SvetlanaNeural and others
    • Quality: Very good
  4. Amazon Polly

    • Pricing: .20/1M standard, .80/1M neural
    • Russian support: Available
    • Quality: Good

Performance Comparison

Latency Analysis:

  • Piper TTS: 20-30ms (100x faster, but GPL licensing issue)
  • Current OpenAI: 1-3 seconds + network latency
  • Cloud TTS services: 1-2 seconds typical
  • macOS native: Very fast (~200ms, but non-commercial)
  • Festival TTS: Fast local processing (~500ms)

Russian Language Quality Ranking:

  1. Google Cloud TTS: Best neural voices for Russian
  2. macOS Milena voice: Excellent but non-commercial
  3. Piper TTS: Very good Russian support (but GPL)
  4. Azure TTS: Good Russian neural voices
  5. Current OpenAI: Decent, optimized for English
  6. Amazon Polly: Adequate Russian support
  7. Festival TTS: Basic quality, robotic sound
  8. eSpeak-NG: Robotic, basic phonemes

Implementation Recommendations

Phase 1: Current State (Keep as-is)

  • Rationale: OpenAI gpt-4o-mini-tts is already optimal for cost/quality balance
  • Action: No changes needed, current implementation is excellent

Phase 2: Quality Enhancement (Optional)

  • Primary: Add Google Cloud TTS integration for better Russian voices
  • Implementation: Use 1M free characters/month, fallback to OpenAI
  • Benefits: Superior Russian voice quality + cost optimization

Phase 3: Offline Capability (Future)

  • Add: Festival TTS as offline fallback option
  • Trade-off: Basic quality but no internet dependency
  • Use case: Privacy-focused users or network issues

Key Insights

  1. Current choice validated: OpenAI gpt-4o-mini-tts is actually the most cost-effective option in 2025
  2. GPL license trap: Many promising open-source TTS engines became GPL, making them unsuitable for commercial products
  3. Google Cloud opportunity: 1M free characters/month provides significant value for experimentation
  4. Hybrid approach optimal: Combine cloud quality with offline fallback options

Action Items for Implementation

  • Research Google Cloud TTS Java SDK integration with Spring AI
  • Create TTS provider abstraction interface
  • Implement Google Cloud TTS provider with free tier management
  • Add configuration for TTS engine selection
  • Test Festival TTS installation and Russian voice quality
  • Document licensing considerations for each TTS option

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions