Towards Emotionally Consistent Text-Based Speech Editing: Introducing EmoCorrector and The ECD-TSE Dataset

Rui Liu, Pu Gao, Jiatian Xi, Berrak Sisman, Carlos Busso, Haizhou Li

Abstract

Text-based speech editing (TSE) allows users to modify audio recordings by simply editing the corresponding transcript. While current models excel at maintaining speaker identity and linguistic accuracy, they frequently suffer from "emotional mismatch," where the prosody of the edited segment fails to reflect the emotional shift in the text. This paper introduces EmoCorrector, a post-correction framework that utilizes Retrieval-Augmented Generation (RAG) and adversarial speaker-emotion disentanglement to align speech prosody with edited text. To support this task, we also present the ECD-TSE dataset, featuring 90 hours of emotionally diverse speech with minimal text variations. Our evaluations show that EmoCorrector improves emotional accuracy from ~7% to ~48% while significantly boosting subjective quality scores across multiple state-of-the-art TSE models.

Introduction: The Emotional Mismatch Problem

Text-based speech editing (TSE) has become a powerful tool for digital media creation, enabling seamless audio corrections without the need for re-recording. However, a significant hurdle remains: the "prosody problem." Current state-of-the-art models are effective at swapping words while maintaining speaker consistency, but they often fail to update the global emotional tone of the utterance.

For example, if a user changes the sentence "Today's weather is really great!" to "Today's weather is really bad!", a traditional TSE model might successfully insert the word "bad," but the speaker's voice will likely remain cheerful and upbeat. This emotional inconsistency makes the edited audio sound unnatural and jarring to the listener. As illustrated in Figure 1, this mismatch between the edited text's sentiment and the generated speech's emotion is a critical failure point in existing systems.

The emotional mismatch problem in traditional TSE versus the proposed EmoCorrector solution.

Methodology: The EmoCorrector Framework

To address this, we propose EmoCorrector, a three-stage post-correction pipeline that treats emotion alignment as a retrieval and synthesis task. The framework is designed to be model-agnostic, allowing it to enhance various existing TSE architectures.

1. Text-Speech Emotion Retrieval (EmoCLAP)

Inspired by Contrastive Language-Audio Pretraining (CLAP), we developed EmoCLAP. This component creates a shared embedding space where text and speech with similar emotional content are mapped close together. When a user edits text, the system uses the new text string to "look up" the appropriate emotional prosody from a pre-constructed database.

2. Speaker-Emotion Disentanglement

A key challenge in emotion correction is ensuring that the process does not inadvertently change the speaker's identity. EmoCorrector employs adversarial training with a Gradient Reversal Layer (GRL) to disentangle speaker-specific traits from emotional features. This ensures the model can manipulate the "mood" of the voice without altering the "voice quality" of the original speaker.

3. Emotion Post-Correction via RAG

In the final stage, the system extracts emotional features from the edited text, retrieves the top $K$ matching speech samples from the database, and uses these as a reference. The speech is then re-synthesized, blending the original speaker's identity with the newly retrieved emotional prosody to produce a consistent output. The complete workflow is detailed in Figure 2.

The EmoCorrector workflow, illustrating the retrieval, disentanglement, and post-correction stages.

The ECD-TSE Dataset

Existing datasets like ESD or IEMOCAP lack the "text variants" necessary for training emotion-aware TSE models—sentences where minor word changes trigger significant emotional shifts. We developed the ECD-TSE (Emotion Correction Dataset for TSE) to fill this gap. Using ChatGPT-4, we generated neutral base sentences and modified them slightly to elicit five distinct emotions (Happy, Sad, Neutral, Angry, Fear). The resulting dataset contains 84,000 speech samples across 12 speakers, totaling approximately 90 hours of audio.

Experimental Results

We evaluated EmoCorrector against four advanced TSE baselines: EditSpeech, $A^3T$, FluentSpeech, and VoiceCraft. The results demonstrate substantial improvements across all key metrics:

  • Subjective Quality (TSE-MOS): Human listeners rated the emotional consistency of EmoCorrector's output significantly higher, with an average score increase of 0.73 points over baseline models.
  • Objective Accuracy (TSEAcc): The accuracy of matching speech emotion to text jumped from a baseline average of ~7% to approximately 48%.
  • Acoustic Integrity: Metrics such as Energy and MFCC similarity remained high, confirming that the emotional correction process does not degrade the fundamental audio quality or speaker similarity (ECS).

Conclusion

EmoCorrector effectively bridges the gap between linguistic content and emotional prosody in text-based speech editing. By leveraging retrieval-augmented generation and adversarial disentanglement, it provides a robust solution to the emotional mismatch problem. Future research will explore integrating these correction capabilities directly into the initial generation phase of TSE models to improve computational efficiency.

Summary updated

BibTeX
@inproceedings{liu2025towards,
  author = {Rui Liu and Pu Gao and Jiatian Xi and Berrak Sisman and Carlos Busso and Haizhou Li},
  title = {{Towards Emotionally Consistent Text-Based Speech Editing: Introducing EmoCorrector and The ECD-TSE Dataset}},
  booktitle = {Interspeech},
  year = {2025},
  doi = {10.21437/interspeech.2025-559},
}
Figure