LongCat-Audio-Codec is an audio tokenizer and detokenizer solution designed for speech large language models. It works by generating semantic and acoustic tokens in parallel, enabling high-fidelity audio reconstruction at extremely low bitrates with excellent backend support for Speech LLM.
Note: The torch version listed in below is just an example. Please install the version of PyTorch that matches your specific hardware configuration
conda create -n LongCat-Audio-Codec python=3.10
conda activate LongCat-Audio-Codec
pip install torch==2.7.1 torchaudio==2.7.1
pip install -r requirements.txt
| Models | Download Link | Notes |
|---|---|---|
| LongCatAudioCodec_encoder | 🤗 Huggingface | encoder weights with semantic encoder and acoustic encoder |
| LongCatAudioCodec_encoder_cmvn | 🤗 Huggingface | coefficients of Cepstral Mean and Variance Normalization, used by semantic encoder |
| LongCatAudioCodec_decoder16k_4codebooks | 🤗 Huggingface | 16k decoder, supply 1 semantic codebook and at most 3 acoustic codebooks |
| LongCatAudioCodec_decoder24k_2codebooks | 🤗 Huggingface | 24k decoder, supply 1 semantic codebook and 1 acoustic codebook, SFT on limited speakers |
| LongCatAudioCodec_decoder24k_4codebooks | 🤗 Huggingface | 24k decoder, supply 1 semantic codebook and at most 3 acoustic codebooks |
After downloading the model checkpoint files (.pt files), you have two options for making them accessible to the inference script:
Option 1: Place Models in the Default ckpts Directory (Recommended)
For a quick setup,all models and configuration files must be placed within the LongCat-Audio-Codec/ project root directory.
The final, correct project structure should look exactly like this:
LongCat-Audio-Codec/ <-- Project Root
├── ckpts/
│ ├── LongCatAudioCodec_decoder_16k_4codebooks.pt
│ ├── LongCatAudioCodec_decoder_24k_2codebooks.pt
│ ├── LongCatAudioCodec_decoder_24k_4codebooks.pt
│ ├── LongCatAudioCodec_encoder.pt
| └── LongCatAudioCodec_encoder_cmvn.npy
├── configs/
│ ├── LongCatAudioCodec_decoder_16k_4codebooks.yaml
│ ├── LongCatAudioCodec_decoder_24k_2codebooks.yaml
│ ├── LongCatAudioCodec_decoder_24k_4codebooks.yaml
│ └── LongCatAudioCodec_encoder.yaml
├── inference.py
└── run_inference.sh
└── ... (e.g., README.md, .git folder)
Option 2: Modify Configuration Files (.yaml) to Point to Custom Paths
If you prefer to store your models in a different location, you must update their paths in the corresponding .yaml configuration files. This is a more advanced option for users who want full control over their file structure.
You will need to edit files in two main locations to relocate LongCat-Audio-Codec model:
To relocate a LongCat-Audio-Codec model, change configs/LongCatAudioCodec_xxx.yaml like this:
# Original:
ckpt_path: 'ckpts/LongCatAudioCodec_decoder_24k_2codebooks.pt'
# Modified:
ckpt_path: '/path/to/my/models/LongCatAudioCodec_decoder_24k_2codebooks.pt'
This project includes a convenient script to demonstrate the core functionalities of LongCat-Audio-Codec.
For a quick start, simply run the provided shell script from the project's root directory. This will process a predefined list of audio files from the demos/org folder and save the reconstructed outputs.
bash ./run_inference.sh
After execution, you will find the reconstructed audio files in the demo_audio_output/ directory.
The run_inference.sh script automates the process of calling the main Python script, inference.py. It demonstrates two key features:
You can easily customize the demo by modifying the run_inference.sh script or by running inference.py directly with your own arguments.
a) Modifying the Script (run_inference.sh)
Open run_inference.sh in a text editor to change the default behavior:
To process your own audio files: Modify the AUDIO_FILES variable to include the paths to your files.
AUDIO_FILES="path/to/your/audio1.wav \
path/to/your/audio2.wav"
To change the number of acoustic codebooks:
Adjust the N_ACOUSTIC_CODEBOOKS variable. This controls the trade-off between quality and bitrate (higher numbers generally mean better quality). Note that the total number of codebooks used is N_ACOUSTIC_CODEBOOKS + 1 (one semantic codebook is always used).
# Use 2 acoustic codebooks (3 total)
N_ACOUSTIC_CODEBOOKS=2
b) Running inference.py Directly
For full control, you can call inference.py with your own arguments. Use --help to see all available options.
python inference.py --help
Example of a custom run:
python inference.py \
--encoder_config "configs/LongCatAudioCodec_encoder.yaml" \
--decoder16k_config "configs/LongCatAudioCodec_decoder_16k_4codebooks.yaml" \
--decoder24k_config "configs/LongCatAudioCodec_decoder_24k_4codebooks.yaml" \
--output_dir "my_custom_output" \
--n_acoustic_codebooks 3 \
--audio_files "path/to/my.wav"
(Note: When running inference.py directly, you must provide all required arguments, such as configs and input files.)
We provide a variety of audio samples to demonstrate the performance of LongCat-Audio-Codec across different emotions and scenarios. In the demos folder:
If you find our work useful in your research, please consider citing:
@article{longcataudiocodec,
title={LongCat-Audio-Codec: An Audio Tokenizer and Detokenizer Solution Designed for Speech Large Language Models},
author={Xiaohan Zhao, Hongyu Xiang, Shengze Ye, Song Li, Zhengkun Tian, Guanyu Chen, Ke Ding, Guanglu Wan},
journal={arXiv preprint arXiv:2510.15227},
organization={LongCat Team, Meituan},
year={2025}
}
The code and models in this repository are released under the MIT License. This grants you broad permissions to use, copy, modify, and distribute the software, provided you include the original copyright notice. We claim no ownership over any content you generate using these models.
The software is provided "AS IS", without any warranty. You are fully accountable for your use of the models. Your usage must not involve creating or sharing any content that violates applicable laws, causes harm to individuals, disseminates personal information with harmful intent, spreads misinformation, or targets vulnerable groups.
Please contact us at longcat-team@meituan.com or join our WeChat Group if you have any questions.

Python
96.7%
Shell
3.3%
LongCat-Audio-Codec is an audio tokenizer and detokenizer solution designed for speech large language models. It works by generating semantic and acoustic tokens in parallel, enabling high-fidelity audio reconstruction at extremely low bitrates with excellent backend support for Speech LLM.
Note: The torch version listed in below is just an example. Please install the version of PyTorch that matches your specific hardware configuration
conda create -n LongCat-Audio-Codec python=3.10
conda activate LongCat-Audio-Codec
pip install torch==2.7.1 torchaudio==2.7.1
pip install -r requirements.txt
| Models | Download Link | Notes |
|---|---|---|
| LongCatAudioCodec_encoder | 🤗 Huggingface | encoder weights with semantic encoder and acoustic encoder |
| LongCatAudioCodec_encoder_cmvn | 🤗 Huggingface | coefficients of Cepstral Mean and Variance Normalization, used by semantic encoder |
| LongCatAudioCodec_decoder16k_4codebooks | 🤗 Huggingface | 16k decoder, supply 1 semantic codebook and at most 3 acoustic codebooks |
| LongCatAudioCodec_decoder24k_2codebooks | 🤗 Huggingface | 24k decoder, supply 1 semantic codebook and 1 acoustic codebook, SFT on limited speakers |
| LongCatAudioCodec_decoder24k_4codebooks | 🤗 Huggingface | 24k decoder, supply 1 semantic codebook and at most 3 acoustic codebooks |
After downloading the model checkpoint files (.pt files), you have two options for making them accessible to the inference script:
Option 1: Place Models in the Default ckpts Directory (Recommended)
For a quick setup,all models and configuration files must be placed within the LongCat-Audio-Codec/ project root directory.
The final, correct project structure should look exactly like this:
LongCat-Audio-Codec/ <-- Project Root
├── ckpts/
│ ├── LongCatAudioCodec_decoder_16k_4codebooks.pt
│ ├── LongCatAudioCodec_decoder_24k_2codebooks.pt
│ ├── LongCatAudioCodec_decoder_24k_4codebooks.pt
│ ├── LongCatAudioCodec_encoder.pt
| └── LongCatAudioCodec_encoder_cmvn.npy
├── configs/
│ ├── LongCatAudioCodec_decoder_16k_4codebooks.yaml
│ ├── LongCatAudioCodec_decoder_24k_2codebooks.yaml
│ ├── LongCatAudioCodec_decoder_24k_4codebooks.yaml
│ └── LongCatAudioCodec_encoder.yaml
├── inference.py
└── run_inference.sh
└── ... (e.g., README.md, .git folder)
Option 2: Modify Configuration Files (.yaml) to Point to Custom Paths
If you prefer to store your models in a different location, you must update their paths in the corresponding .yaml configuration files. This is a more advanced option for users who want full control over their file structure.
You will need to edit files in two main locations to relocate LongCat-Audio-Codec model:
To relocate a LongCat-Audio-Codec model, change configs/LongCatAudioCodec_xxx.yaml like this:
# Original:
ckpt_path: 'ckpts/LongCatAudioCodec_decoder_24k_2codebooks.pt'
# Modified:
ckpt_path: '/path/to/my/models/LongCatAudioCodec_decoder_24k_2codebooks.pt'
This project includes a convenient script to demonstrate the core functionalities of LongCat-Audio-Codec.
For a quick start, simply run the provided shell script from the project's root directory. This will process a predefined list of audio files from the demos/org folder and save the reconstructed outputs.
bash ./run_inference.sh
After execution, you will find the reconstructed audio files in the demo_audio_output/ directory.
The run_inference.sh script automates the process of calling the main Python script, inference.py. It demonstrates two key features:
You can easily customize the demo by modifying the run_inference.sh script or by running inference.py directly with your own arguments.
a) Modifying the Script (run_inference.sh)
Open run_inference.sh in a text editor to change the default behavior:
To process your own audio files: Modify the AUDIO_FILES variable to include the paths to your files.
AUDIO_FILES="path/to/your/audio1.wav \
path/to/your/audio2.wav"
To change the number of acoustic codebooks:
Adjust the N_ACOUSTIC_CODEBOOKS variable. This controls the trade-off between quality and bitrate (higher numbers generally mean better quality). Note that the total number of codebooks used is N_ACOUSTIC_CODEBOOKS + 1 (one semantic codebook is always used).
# Use 2 acoustic codebooks (3 total)
N_ACOUSTIC_CODEBOOKS=2
b) Running inference.py Directly
For full control, you can call inference.py with your own arguments. Use --help to see all available options.
python inference.py --help
Example of a custom run:
python inference.py \
--encoder_config "configs/LongCatAudioCodec_encoder.yaml" \
--decoder16k_config "configs/LongCatAudioCodec_decoder_16k_4codebooks.yaml" \
--decoder24k_config "configs/LongCatAudioCodec_decoder_24k_4codebooks.yaml" \
--output_dir "my_custom_output" \
--n_acoustic_codebooks 3 \
--audio_files "path/to/my.wav"
(Note: When running inference.py directly, you must provide all required arguments, such as configs and input files.)
We provide a variety of audio samples to demonstrate the performance of LongCat-Audio-Codec across different emotions and scenarios. In the demos folder:
If you find our work useful in your research, please consider citing:
@article{longcataudiocodec,
title={LongCat-Audio-Codec: An Audio Tokenizer and Detokenizer Solution Designed for Speech Large Language Models},
author={Xiaohan Zhao, Hongyu Xiang, Shengze Ye, Song Li, Zhengkun Tian, Guanyu Chen, Ke Ding, Guanglu Wan},
journal={arXiv preprint arXiv:2510.15227},
organization={LongCat Team, Meituan},
year={2025}
}
The code and models in this repository are released under the MIT License. This grants you broad permissions to use, copy, modify, and distribute the software, provided you include the original copyright notice. We claim no ownership over any content you generate using these models.
The software is provided "AS IS", without any warranty. You are fully accountable for your use of the models. Your usage must not involve creating or sharing any content that violates applicable laws, causes harm to individuals, disseminates personal information with harmful intent, spreads misinformation, or targets vulnerable groups.
Please contact us at longcat-team@meituan.com or join our WeChat Group if you have any questions.

Python
96.7%
Shell
3.3%