Fish Speech

repository·main·Indexed 12 days ago

https://github.com/fishaudio/fish-speech

A multilingual text-to-speech (TTS) system featuring the S2 Pro model. It utilizes a Dual-Autoregressive architecture for high-fidelity, emotionally expressive voice generation and rapid voice cloning using 10-30 second reference samples. The system supports multi-speaker and multi-turn generation, and provides a Gradio-based WebUI and API server deployable via Docker Compose. Version 2.0.0 includes capabilities for LLAMA fine-tuning using LoRA.

Tokens
16K
Snippets
48
Records
77
Agent score
93%

What's inside Fish Speech

  1. Overview of Fish Audio S2 Pro

    main

    Fish Audio S2 Pro is a multimodal TTS model trained on over 10 million hours of audio data, supporting more than 80 languages.

    Key Features

    • Dual-Autoregressive (Dual-AR) Architecture: An innovative architecture for high-quality speech generation.
    • Sub-word Level Control: Supports fine-grained control over tone and emotion using natural language tags (e.g., [whisper], [excited], [angry]).
    • Long Context Support: Native support for multi-speaker generation and multi-turn dialogues with very long contexts.
    • RL Alignment: Uses Reinforcement Learning to improve speech naturalness and emotional depth.
    • Streaming Performance: Optimized for extreme streaming performance via SGLang.

    Model Variants

    ModelSizeAvailabilityDescription
    S2-Pro4B parametersHuggingFaceLeading full-featured model with highest quality and stability
  2. Fine-grained control using natural language tags

    main

    Fish Audio S2 Pro supports sub-word level control of prosody and emotion using a [tag] syntax. You can insert emotional instructions anywhere in the text to influence the voice output.

    • Supported Tags: Over 15,000 unique tags.
    • Free-form Descriptions: You can use natural language descriptions such as [whisper in small voice], [professional broadcast tone], or [pitch up] to achieve specific effects.
  3. Fine-grained inline control via natural language tags

    main

    Fish Audio S2 Pro allows sub-word level control of prosody and emotion using natural language tags in the format [tag]. You can insert these anywhere in your text to guide the model's expression.

    Capabilities:

    • Free-form descriptions: Supports over 15,000 unique tags, including descriptive text like [whisper in small voice] or [professional broadcast tone].
    • Common emotion/action tags:
      • [pause], [emphasis], [laughing], [inhale], [chuckle], [tsk], [singing], [excited], [laughing tone], [interrupting], [chuckling], [excited tone], [volume up], [echo], [angry], [low volume], [sigh], [low voice], [whisper], [screaming], [shouting], [loud], [surprised], [short pause], [exhale], [delight], [panting], [audience laughter], [with strong accent], [volume down], [clearing throat], [sad], [moaning], [shocked]
  4. Generate multiple speakers in a single session using speaker ID tokens

    main

    Fish Audio S2 allows for native multi-speaker generation. Instead of uploading new reference audio for every speaker change, you can use the <|speaker:i|> token to control which speaker is active. This enables mixing multiple speakers within a single generation task by providing reference audio for each speaker ID.

    <|speaker:0|> Hello, I am the first speaker. <|speaker:1|> And I am the second speaker.
  5. Voice Cloning with Fish Audio S2

    main
    Fish Audio S2 supports rapid and accurate voice cloning using short reference samples, typically between 10 to 30 seconds. The model captures the speaker's timbre, speaking style, and emotional tendencies to produce realistic and consistent cloned voices without the need for additional fine-tuning.
  6. Control speech prosody and emotion with natural language tags

    main

    Fish Audio S2 Pro supports sub-word level control of prosody and emotion using a [tag] syntax. You can embed these tags anywhere in your text to provide fine-grained instructions.

    Key Features:

    • Free-form descriptions: Supports over 15,000 unique tags, including descriptive text like [whisper in small voice] or [professional broadcast tone].
    • Common emotion/instruction tags:
      • Pauses/Breathing: [pause], [short pause], [inhale], [exhale], [clearing throat]
      • Emotions: [excited], [angry], [sad], [surprised], [delight], [shocked]
      • Vocal Styles: [laughing], [chuckle], [sigh], [whisper], [screaming], [shouting], [singing]
      • Volume/Pitch: [emphasis], [volume up], [volume down], [low volume], [low voice], [pitch up]
      • Other: [tsk], [interrupting], [echo], [panting], [audience laughter]
  7. Architecture of Fish Audio S2 Pro

    main

    The S2 Pro model utilizes a Dual-Autoregressive (Dual-AR) architecture:

    1. Slow AR (4B parameters): Responsible for modeling the temporal structure of the audio.
    2. Fast AR (400M parameters): Responsible for reconstructing fine acoustic details.

    The model also utilizes Reinforcement Learning (RL) alignment via GRPO with multidimensional reward signals to ensure high-quality, natural output.

  8. How the Dual-Autoregressive (Dual-AR) architecture works

    main

    The S2 model uses a Dual-AR architecture based on a decoder-only transformer and an RVQ-based audio codec (10 codebooks, ~21 Hz frame rate). Generation is split into two asymmetric stages to balance efficiency and fidelity:

    1. Slow AR: Operates along the time axis and predicts the primary semantic codebook (4B parameters).
    2. Fast AR: Generates the remaining 9 residual codebooks at each time step to reconstruct fine-grained acoustic details (400M parameters).

    This design allows for high-fidelity audio while maintaining efficient inference.

  9. Understand the Dual-Autoregressive (Dual-AR) architecture

    main

    S2 Pro uses a master-slave Dual-AR architecture consisting of a Decoder-only Transformer and an RVQ audio codec (10 codebooks, ~21 Hz). This design separates semantic prediction from acoustic detail restoration:

    1. Slow AR (4B parameters): Operates on the time axis to predict the core semantic codebook.
    2. Fast AR (400M parameters): Generates the remaining 9 residual codebooks at each time step to restore fine acoustic details.

    This asymmetry allows for high audio fidelity while significantly improving inference speed.

  10. Multi-speaker and multi-turn dialogue generation

    main

    Fish Audio S2 supports advanced multi-speaker and conversational capabilities:

    Multi-speaker Generation

    You can upload reference audio containing multiple speakers. The model uses <|speaker:i|> tokens to handle speaker features. You can then control which speaker is active in a single generation sequence by using the corresponding speaker ID tokens.

    Multi-turn Dialogue

    The model's extended context window allows it to use information from previous turns to improve the expressiveness and naturalness of subsequent generations, making it suitable for long-form dialogue.

    Fast Voice Cloning

    Voice cloning can be achieved using short reference samples (typically 10-30 seconds). The model captures timbre, speaking style, and emotional tendencies without requiring additional fine-tuning.

  11. Multi-speaker and Multi-turn generation in Fish Audio S2

    main

    Fish Audio S2 provides advanced capabilities for complex dialogue and speaker management:

    Native Multi-Speaker Generation

    You can upload a single reference audio containing multiple speakers. The model identifies features for each speaker via the <|speaker:i|> token. You can then control which speaker performs which part of the text using these speaker ID tokens, allowing for multi-speaker dialogue in a single generation without needing separate reference files for every individual.

    Multi-Turn Generation

    The model's expanded context allows it to leverage information from previous turns in a conversation. This improves the expressiveness and naturalness of subsequent generated content by maintaining conversational flow.

  12. Dual-Autoregressive (Dual-AR) Architecture

    main

    S2 Pro uses a master-slave Dual-AR architecture consisting of a Decoder-only Transformer and an RVQ audio codec (10 codebooks, ~21Hz frame rate) to balance audio fidelity and inference speed.

    • Slow AR (4B parameters): Operates along the time axis to predict the core semantic codebook.
    • Fast AR (400M parameters): Generates the remaining 9 residual codebooks at each timestep to restore fine-grained acoustic details.