yangdongchao / AcademiCodec

AcademiCodec: An Open Source Audio Codec Model for Academic Research
558 stars 79 forks source link

AcademiCodec: An Open Source Audio Codec Model for Academic Research

This repo is organized as follows:

AcademiCodec
├── academicodec
│   ├── utils.py      # common parts of various models
│   ├── modules       # common parts of various models
│   ├── ...
│   ├── quantization  # common parts of various models
│   └── models        # parts that are not shared by various models
│        ├── hificodec
│        ├── encodec
│        ├── soundstream
│        └── ... 
├── evaluation_metric
├── egs
│    ├── SoundStream*
│    ├── EnCodec*
│    └── HiFi-Codec*
│          ├── start.sh
│          ├── ...
│          └── test.sh
└── README.md

On going

This project is on going. You can find the paper on https://arxiv.org/pdf/2305.02765.pdf
Furthermore, this project is lanched from University, we expect more researchers to be the contributor.

Abstract

Audio codec models are widely used in audio communication as a crucial technique for compressing audio into discrete representations. Nowadays, audio codec models are increasingly utilized in generation fields as intermediate representations. For instance, AudioLM is ann audio generation model that uses the discrete representation of SoundStream as a training target, while VALL-E employs the Encodec model as an intermediate feature to aid TTS tasks. Despite their usefulness, two challenges persist: (1) training these audio codec models can be difficult due to the lack of publicly available training processes and the need for large-scale data and GPUs; (2) achieving good reconstruction performance requires many codebooks, which increases the burden on generation models. In this study, we propose a group-residual vector quantization (GRVQ) technique and use it to develop a novel \textbf{Hi}gh \textbf{Fi}delity Audio Codec model, HiFi-Codec, which only requires 4 codebooks. We train all the models using publicly available TTS data such as LibriTTS, VCTK, AISHELL, and more, with a total duration of over 1000 hours, using 8 GPUs. Our experimental results show that HiFi-Codec outperforms Encodec in terms of reconstruction performance despite requiring only 4 codebooks. To facilitate research in audio codec and generation, we introduce AcademiCodec, the first open-source audio codec toolkit that offers training codes and pre-trained models for Encodec, SoundStream, and HiFi-Codec.

🔥 News

AcademiCodec

Train your own model

please refer to the specific version.

Data preparation

Just prepare your audio data in one folder. Make sure the sample rate is right.

Training or Inferce

Refer to the specical folders, e.g. Encodec_24k_240d represent, the Encodec model, sample rate is 24khz, downsample rate is 240. If you want to use our pre-trained models, please refer to https://huggingface.co/Dongchao/AcademiCodec/tree/main

Version Description

Acknowledgements

This implementation uses parts of the code from the following Github repos: https://github.com/facebookresearch/encodec
https://github.com/yangdongchao/Text-to-sound-Synthesis
https://github.com/b04901014/MQTTS

Citations

If you find this code useful in your research, please cite our work:

@article{yang2023instructtts,
  title={InstructTTS: Modelling Expressive TTS in Discrete Latent Space with Natural Language Style Prompt},
  author={Yang, Dongchao and Liu, Songxiang and Huang, Rongjie and Lei, Guangzhi and Weng, Chao and Meng, Helen and Yu, Dong},
  journal={arXiv preprint arXiv:2301.13662},
  year={2023}
}
@article{yang2023hifi,
  title={HiFi-Codec: Group-residual Vector quantization for High Fidelity Audio Codec},
  author={Yang, Dongchao and Liu, Songxiang and Huang, Rongjie and Tian, Jinchuan and Weng, Chao and Zou, Yuexian},
  journal={arXiv preprint arXiv:2305.02765},
  year={2023}
}

Disclaimer

MIT license