CoolFace
Apppublic

Yaya5777/bark-tts

sourceHugging Facemitupdated 11mo agoView on Hugging Face
1likes
App README

🎭 Bark TTS HuggingFace Space

Test Alternative to XTTS - More Human Voices!

This is a Bark TTS implementation for testing as an alternative to XTTS.


🌟 Why Bark is Better Than XTTS

1. More Human-Like (8/10 vs XTTS 6/10)

  • β€”Natural emotions built-in
  • β€”Non-deterministic (each generation slightly different = more human)
  • β€”Includes laughter, sighs, breathing naturally

2. Expressive Speech

  • β€”[laughs] - Add laughter
  • β€”[sighs] - Add sighing
  • β€”[gasps] - Add gasping
  • β€”... - Natural pauses
  • β€”CAPS - Emphasis
  • β€”? - Question intonation

3. No Rate Limits

  • β€”Runs locally on HuggingFace Space
  • β€”No API calls to external services
  • β€”Truly FREE

4. 100+ Voices

  • β€”10+ languages
  • β€”Multiple accents per language
  • β€”Male/female, young/old variations

πŸš€ Available Voices

English (10 voices)

  • β€”en_speaker_0 - Male, Young, American
  • β€”en_speaker_1 - Male, Middle, American
  • β€”en_speaker_2 - Male, Old, American
  • β€”en_speaker_3 - Female, Young, American
  • β€”en_speaker_4 - Female, Middle, American
  • β€”en_speaker_5 - Female, Old, American
  • β€”en_speaker_6 - Male, Young, British
  • β€”en_speaker_7 - Female, Young, British
  • β€”en_speaker_8 - Male, Middle, Australian
  • β€”en_speaker_9 - Female, Middle, Canadian

Spanish (10 voices)

  • β€”Spanish, Mexican, Argentine, Colombian accents
  • β€”Male/female, young/old variations

French (10 voices)

  • β€”French, Canadian, Belgian, Swiss accents
  • β€”Male/female, young/old variations

German (10 voices)

  • β€”German, Austrian, Swiss accents
  • β€”Male/female, young/old variations

Italian (10 voices)

  • β€”Italian, Sicilian, Tuscan, Venetian, Roman accents
  • β€”Male/female, young/old variations

Plus: Portuguese, Chinese, Japanese, Korean, Hindi, Polish, Turkish, Russian

Total: 100+ voices across 12+ languages


🎯 API Endpoints

Health Check

bash
GET /

Returns system status and features.

List Voices

bash
GET /voices

Returns all 100+ available voices with metadata.

Synthesize Speech

bash
POST /synthesize
Content-Type: multipart/form-data

Parameters:
- text (required): Text to synthesize (max 500 chars)
- voice_id (optional): Voice ID (default: en_speaker_3)
- temperature (optional): Variation level 0.0-1.0 (default: 0.7)
- use_special_syntax (optional): Enable [laughs], etc. (default: true)

πŸ§ͺ Testing Examples

Basic Speech

bash
curl -X POST https://your-space.hf.space/synthesize \
  -F "text=Hello, how are you today?" \
  -F "voice_id=en_speaker_3" \
  --output test.wav

With Laughter

bash
curl -X POST https://your-space.hf.space/synthesize \
  -F "text=Hello! [laughs] That's so funny!" \
  -F "voice_id=en_speaker_3" \
  --output laugh_test.wav

With Emphasis

bash
curl -X POST https://your-space.hf.space/synthesize \
  -F "text=This is AMAZING! I'm so excited!" \
  -F "voice_id=en_speaker_3" \
  --output emphasis_test.wav

With Pauses

bash
curl -X POST https://your-space.hf.space/synthesize \
  -F "text=Well... I think... maybe we should try this." \
  -F "voice_id=en_speaker_3" \
  --output pause_test.wav

Question Intonation

bash
curl -X POST https://your-space.hf.space/synthesize \
  -F "text=Really? Are you sure about that?" \
  -F "voice_id=en_speaker_3" \
  --output question_test.wav

Different Languages

bash
# French
curl -X POST https://your-space.hf.space/synthesize \
  -F "text=Bonjour! Comment allez-vous?" \
  -F "voice_id=fr_speaker_2" \
  --output french_test.wav

# Spanish
curl -X POST https://your-space.hf.space/synthesize \
  -F "text=Β‘Hola! ΒΏCΓ³mo estΓ‘s?" \
  -F "voice_id=es_speaker_2" \
  --output spanish_test.wav

# German
curl -X POST https://your-space.hf.space/synthesize \
  -F "text=Guten Tag! Wie geht es Ihnen?" \
  -F "voice_id=de_speaker_2" \
  --output german_test.wav

# Italian
curl -X POST https://your-space.hf.space/synthesize \
  -F "text=Ciao! Come stai?" \
  -F "voice_id=it_speaker_2" \
  --output italian_test.wav

⚑ Performance

Speed:

  • β€”CPU: 10-15 seconds per request
  • β€”GPU: 2-4 seconds per request

Quality:

  • β€”8/10 human-like (better than XTTS 6/10)
  • β€”Natural emotions and prosody
  • β€”Includes non-verbal sounds

Limitations:

  • β€”Max 500 characters per request (Bark limitation)
  • β€”Slower than Piper TTS (but better quality)
  • β€”Non-deterministic (same text = different audio each time)

πŸ“Š Comparison with XTTS

FeatureXTTSBark
Human-like6/108/10 βœ…
Speed (CPU)15-20s10-15s βœ…
EmotionsManualBuilt-in βœ…
LaughterβŒβœ…
Sighs/GaspsβŒβœ…
Rate Limitsβœ… Freeβœ… Free
Voice Cloningβœ…βŒ
Accents88 voices100+ voices βœ…

Winner: Bark for more human-like, expressive speech!


πŸš€ Deployment

Create HuggingFace Space:

  1. 1.Go to https://huggingface.co/spaces
  2. 2.Click "Create new Space"
  3. 3.Name: bark-tts or voxly-bark
  4. 4.SDK: Docker
  5. 5.Hardware: CPU Basic (or GPU for faster)

Upload Files:

bash
git clone https://huggingface.co/spaces/YOUR_USERNAME/bark-tts
cd bark-tts
cp /path/to/bark-tts/* .
git add .
git commit -m "🎭 Bark TTS - Human-like voices with emotions"
git push

Test After Deployment:

bash
# Wait 5-10 minutes for build
# Then test:
curl https://YOUR_USERNAME-bark-tts.hf.space/
curl https://YOUR_USERNAME-bark-tts.hf.space/voices

πŸŽ‰ What You Get

βœ… More human voices than XTTS βœ… Natural emotions (laughter, sighs, gasps) βœ… 100+ voices across 12+ languages βœ… No rate limits (truly free) βœ… Expressive speech with special syntax βœ… Question intonation automatically βœ… Natural pauses and emphasis

Test it and compare with XTTS! πŸš€