- Notifications
You must be signed in to change notification settings - Fork3
A collections of audio codecs with a standardized API
License
lucadellalib/audiocodecs
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A collection of audio codecs with astandardized API for easy integration and benchmarking.
- BigCodec
- DAC
- EnCodec
- EnCodec +Vocos
- FocalCodec
- Mimi
- SemantiCodec
- SpeechTokenizer
- Stable Codec
- WavLM k-means
- WavTokenizer
First of all, installPython 3.8 or later.
To install the packagewith all available codecs, open a terminal and run:
pip install audiocodecs@git+https://github.com/lucadellalib/audiocodecs.git@main#egg=audiocodecs[all]
If you encounter issues (e.g. codec installation conflicts with certain PyTorch versions or platforms),you can install the packagewithout codecs, and install the codec manually as needed:
pip install audiocodecs@git+https://github.com/lucadellalib/audiocodecs.git@main#egg=audiocodecs
To check the reconstruction quality of a codec, navigate to the<path-to-repository>/audiocodecs directory and run:
python<codec-name>.py
This will generate a file namedreconstruction.wav corresponding toexample.wav in the same directory.
To use one of the available codecs in your script (for example EnCodec):
importtorchaudiofromaudiocodecsimportEncodecaudio_file="audiocodecs/example.wav"sig,sample_rate=torchaudio.load(audio_file)model=Encodec(sample_rate=sample_rate,orig_sample_rate=24000,num_codebooks=8)model.requires_grad_(False).eval()toks=model.sig_to_toks(sig)rec_sig=model.toks_to_sig(toks)torchaudio.save("reconstruction.wav",rec_sig,sample_rate)
Reference implementations of downstream tasks using these audio codecs can be found in thedownstream directory.
@article{dellalibera2025focalcodec, title = {{FocalCodec}: Low-Bitrate Speech Coding via Focal Modulation Networks}, author = {Luca {Della Libera} and Francesco Paissan and Cem Subakan and Mirco Ravanelli}, journal = {arXiv preprint arXiv:2502.04465}, year = {2025},}@article{speechbrainV1, title = {Open-Source Conversational {AI} with {SpeechBrain} 1.0}, author = {Mirco Ravanelli and Titouan Parcollet and Adel Moumen and Sylvain de Langen and Cem Subakan and Peter Plantinga and Yingzhi Wang and Pooneh Mousavi and Luca {Della Libera} and Artem Ploujnikov and Francesco Paissan and Davide Borra and Salah Zaiem and Zeyu Zhao and Shucong Zhang and Georgios Karakasidis and Sung-Lin Yeh and Pierre Champion and Aku Rouhe and Rudolf Braun and Florian Mai and Juan Zuluaga-Gomez and Seyed Mahed Mousavi and Andreas Nautsch and Ha Nguyen and Xuechen Liu and Sangeet Sagar and Jarod Duret and Salima Mdhaffar and Ga{{\"e}}lle Laperri{{\`e}}re and Mickael Rouvier and Renato De Mori and Yannick Est{{\`e}}ve}, journal = {Journal of Machine Learning Research (JMLR)}, year = {2024}, volume = {25}, number = {333}, pages = {1--11},}@article{ravanelli2021speechbrain, title = {{SpeechBrain}: A General-Purpose Speech Toolkit}, author = {Mirco Ravanelli and Titouan Parcollet and Peter Plantinga and Aku Rouhe and Samuele Cornell and Loren Lugosch and Cem Subakan and Nauman Dawalatabad and Abdelwahab Heba and Jianyuan Zhong and Ju-Chieh Chou and Sung-Lin Yeh and Szu-Wei Fu and Chien-Feng Liao and Elena Rastorgueva and François Grondin and William Aris and Hwidong Na and Yan Gao and Renato De Mori and Yoshua Bengio}, journal = {arXiv preprint arXiv:2106.04624}, year = {2021},}About
A collections of audio codecs with a standardized API
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Uh oh!
There was an error while loading.Please reload this page.