Views
No views yet

1# Install Pytorch GPU (version >= 1.12.0):
2conda install pytorch==1.12.0
3# for other versions, please refer: https://pytorch.org/get-started/locally
4
5# Download codebase:
6git clone https://github.com/alibaba-damo-academy/FunCodec.git
7
8# Install FunCodec codebase:
9cd FunCodec
10pip install --editable ./1# Enter the example directory
2cd egs/LibriTTS/codec
3# Specify the model name
4model_name="audio_codec-encodec-en-libritts-16k-nq32ds320-pytorch"
5# Download the model
6git lfs install
7git clone https://huggingface.co/alibaba-damo/${model_name}
8mkdir exp
9mv ${model_name} exp/$model_name
10# Extracting codec within the input file "input_wav.scp" and the codecs are saved under "outputs/codecs"
11bash encoding_decoding.sh --stage 1 --batch_size 16 --num_workers 4 --gpu_devices "0,1" \
12 --model_dir exp/${model_name} --bit_width 16000 --file_sampling_rate 16000 \
13 --wav_scp input_wav.scp --out_dir outputs/codecs
14# input_wav.scp has the following format:
15# uttid1 path/to/file1.wav
16# uttid2 path/to/file2.wav
17# ...1# Reconstruct waveforms into "outputs/recon_wavs"
2bash encoding_decoding.sh --stage 2 --batch_size 16 --num_workers 4 --gpu_devices "0,1" \
3 --model_dir exp/${model_name} --bit_width 16000 --file_sampling_rate 16000 \
4 --wav_scp outputs/codecs/codecs.txt --out_dir outputs/recon_wavs
5# codecs.txt is the output of stage 1, which has the following format:
6# uttid1 [[[1, 2, 3, ...],[2, 3, 4, ...], ...]]
7# uttid2 [[[9, 7, 5, ...],[3, 1, 2, ...], ...]]
8# ...| testset | 50 tk/s | 100 tk/s | 200 tk/s | 400 tk/s |
|---|---|---|---|---|
| LibriTTS | 3.43 | 3.86 | 4.12 | 4.29 |
1@misc{du2023funcodec,
2 title={FunCodec: A Fundamental, Reproducible and Integrable Open-source Toolkit for Neural Speech Codec},
3 author={Zhihao Du, Shiliang Zhang, Kai Hu, Siqi Zheng},
4 year={2023},
5 eprint={2309.07405},
6 archivePrefix={arXiv},
7 primaryClass={cs.Sound}
8}