Views
No views yet
| Model | Speech Sample Rate | codebooks | Bit Rate | Token Rate | version |
|---|---|---|---|---|---|
| weights_24khz_3.0kbps_v1.0.pth | 24kHz | 4 | 3kHz | 300Hz | 1.0 |
| weights_24khz_1.5kbps_v1.0.pth | 24kHz | 2 | 1.5kHz | 150Hz | 1.0 |
git clone https://huggingface.co/ibm/DAC.speech.v1.0
cd DAC.speech.v1.0python3 -m dac encode /path/to/input --output /path/to/output/codes --weights_path weights_24khz_3.0kbps_v1.0.pth.dac files with the same name as the input files. It will also preserve the directory structure relative to input root and re-create it in the output directory. Please use python -m dac encode --help for more options.python3 -m dac decode /path/to/output/codes --output /path/to/reconstructed_input --weights_path weights_24khz_3.0kbps_v1.0.pth.wav files with the same name as the input files. It will also preserve the directory structure relative to input root and re-create it in the output directory. Please use python -m dac decode --help for more options.1import dac
2from audiotools import AudioSignal
3
4# Download a model
5model_path = 'weights_24khz_3.0kbps_v1.0.pth'
6model = dac.DAC.load(model_path)
7
8model.to('cuda')
9
10# Load audio signal file
11signal = AudioSignal('input.wav')
12
13# Encode audio signal as one long file
14# (may run out of GPU memory on long files)
15signal.to(model.device)
16
17x = model.preprocess(signal.audio_data, signal.sample_rate)
18z, codes, latents, _, _ = model.encode(x)
19
20# Decode audio signal
21y = model.decode(z)
22
23# Alternatively, use the `compress` and `decompress` functions
24# to compress long files.
25
26signal = signal.cpu()
27x = model.compress(signal)
28
29# Save and load to and from disk
30x.save("compressed.dac")
31x = dac.DACFile.load("compressed.dac")
32
33# Decompress it back to an AudioSignal
34y = model.decompress(x)
35
36# Write to file
37y.write('output.wav')1@inproceedings{shechtman24_interspeech,
2 title = {Low Bitrate High-Quality RVQGAN-based Discrete Speech Tokenizer},
3 author = {Slava Shechtman and Avihu Dekel},
4 year = {2024},
5 booktitle = {Interspeech 2024},
6 pages = {4174--4178},
7 doi = {10.21437/Interspeech.2024-2366},
8 issn = {2958-1796},
9}