Abstract
Modern zero-shot Text-to-Speech (TTS) systems often struggle with stylistic consistency when prompts are selected randomly. This paper introduces a Retrieval-Augmented Generation (RAG) framework that leverages a novel Context-Aware Contrastive Language-Audio Pretraining (CA-CLAP) model. By incorporating narrative context into the retrieval process, the system identifies the most stylistically appropriate speech prompts for a given text. Evaluation on a large-scale Chinese audiobook dataset shows significant improvements in both naturalness and speaker similarity compared to traditional methods.
Introduction
Zero-shot TTS models, such as VALL-E and GPT-SoVITS, have demonstrated remarkable capabilities in cloning voices from short audio prompts. However, the performance of these models is highly dependent on the acoustic and stylistic properties of the provided prompt. In scenarios like audiobook narration, where the emotional tone varies significantly across different passages, static or random prompt selection often leads to prosodic mismatches. To address this, we propose treating prompt selection as a retrieval task that considers the broader narrative context.
The RAG Framework
The proposed system operates in three distinct stages: indexing, retrieval, and generation.
- Indexing: A large database of audio-text pairs is processed. A pretrained CA-CLAP audio encoder generates style-representative embeddings for each speech segment, which are then stored in a searchable database.
- Retrieval: For a target sentence, the system considers both the current text and its surrounding context (e.g., five preceding and following sentences). The CA-CLAP text encoder converts this information into a query embedding to retrieve the top $K$ most stylistically similar audio samples.
- Generation: The retrieved prompts are used as stylistic references for a backbone TTS model (e.g., GPT-SoVITS) to synthesize the target speech.
Context-Aware Contrastive Language-Audio Pretraining (CA-CLAP)
The core innovation is the CA-CLAP model, which aligns text and audio in a shared stylistic embedding space. Unlike standard text encoders that focus on semantic meaning, CA-CLAP is trained to capture acoustic style.
As shown in the architecture diagram, CA-CLAP utilizes a cross-attention mechanism to integrate the target text with its context. This allows the model to distinguish between different narrative moods—such as an intense dialogue versus a descriptive passage—and retrieve audio prompts that match that specific "vibe." The text-to-semantic model then uses these prompts to guide the synthesis process.
Experimental Results
The framework was trained on a 616-hour dataset of Chinese audiobooks. Key findings include:
- Context Length: Experiments revealed that a context window of 5 sentences provides the optimal balance between stylistic detail and noise reduction. Beyond this point, performance degrades as irrelevant information introduces noise.
- Objective Performance: The CA-CLAP retrieval method achieved a Mel-Cepstral Distortion (MCD) of 6.507 and a Speaker Encoder Cosine Similarity (SECS) of 0.734, outperforming random and text-only baselines.
- Subjective Quality: In human evaluations, the proposed method reached a Naturalness MOS (NMOS) of 3.922 and a Similarity MOS (SMOS) of 3.778, indicating a substantial improvement in the immersive quality of the synthesized audio.
Conclusion
By integrating context-aware retrieval into the TTS pipeline, this RAG framework significantly enhances the stylistic accuracy of zero-shot speech synthesis. The system successfully matches emotional cues, such as retrieving "angry" prompts for intense scenes, leading to more natural and expressive audiobooks. Future work will focus on extending this approach to multi-lingual datasets and optimizing retrieval latency for real-time applications.
Summary updated