🤗 Hugging Face | 🖥️ Demo | 📑 Paper
Language model based text-to-speech (TTS) models, like VALL-E, have gained attention for their outstanding in-context learning capability in zero-shot scenarios. Neural speech codec is a critical component of these models, which can convert speech into discrete token representations. However, excessive token sequences from the codec may negatively affect prediction accuracy and restrict the progression of Language model based TTS models. To address this issue, this paper proposes a novel neural speech codec with time-invariant codes named TiCodec. By encoding and quantizing time-invariant information into a separate code, TiCodec can reduce the amount of frame-level information that needs encoding, effectively decreasing the number of tokens as codes of speech. Furthermore, this paper introduces a time-invariant encoding consistency loss to enhance the consistency of time-invariant code within an utterance, which can benefit the zero-shot TTS task. Experimental results demonstrate that TiCodec can not only enhance the quality of reconstruction speech with fewer tokens but also increase the similarity and naturalness, as well as reduce the word error rate of the synthesized speech by the TTS model.
pip install -r requirement.txt
Install visqol for calculating objective metrics.
Gengenerate ./Lib_resources/*/*.lst for training.
.
├── Lib_resources
│ └── LibriTTS
│ ├── dev.lst
│ ├── test.lst
│ └── train.lst
Put *.wav in ./egs/Paper_Data/GT/*/*.wav for metrics.
.
├── Paper_Data
│ ├── GEN
│ └── GT
cd TiCodec/egs/TiCodec-24k-320d
bash start_conv_1g1r_8g3k1s_cos_from_head.sh
bash start_conv_1g2r_8g3k1s_cos_from_head.sh
bash start_conv_1g4r_8g3k1s_cos_from_head.sh
test_conv_1g1r_8g3k1s_cos_from_head.sh
test_conv_1g2r_8g3k1s_cos_from_head.sh
test_conv_1g4r_8g3k1s_cos_from_head.sh
python metrics.py
If our code and paper help you, please kindly cite:
@inproceedings{ren2024fewer,
title={Fewer-token neural speech codec with time-invariant codes},
author={Ren, Yong and Wang, Tao and Yi, Jiangyan and Xu, Le and Tao, Jianhua and Zhang, Chu Yuan and Zhou, Junzuo},
booktitle={ICASSP 2024-2024 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)},
pages={12737--12741},
year={2024},
organization={IEEE}
}
This repo is based on AcademiCodec. We highly appreciate their contributions to this community.
License: The repository is licensed under the Apache 2.0 License.