Descript Audio Codec — MLX
Implementation of the Descript Audio Codec, with the MLX framework.
Descript can compress 44kHz audio into discrete codes at 8kbps and produces high quality reconstructions at a 90:1 compression ratio compared to the raw audio.
This repository is based on the original Pytorch implementation available here.
Installation
pip install descript-mlx
Usage
You can load a pretrained model from Python like this:
import mlx.core as mx
from descript_mlx import DAC
dac = DAC.from_pretrained("44khz") # or "24khz" / "16khz"
audio = mx.array(...)
# encode into latents and codes
z, codes, latents, commitment_loss, codebook_loss = dac.encode(audio)
# reconstruct from latents/codes to audio
reconstucted_audio = dac.decode(z)
# compress audio to a DAC file
dac_file = dac.compress(audio)
dac_file.save("/path/to/file.dac")
# decompress audio from a DAC file
reconstructed_audio = dac.decompress("/path/to/file.dac")
Citations
@misc{kumar2023highfidelityaudiocompressionimproved,
title={High-Fidelity Audio Compression with Improved RVQGAN},
author={Rithesh Kumar and Prem Seetharaman and Alejandro Luebs and Ishaan Kumar and Kundan Kumar},
year={2023},
eprint={2306.06546},
archivePrefix={arXiv},
primaryClass={cs.SD},
url={https://arxiv.org/abs/2306.06546},
}
License
The code in this repository is released under the MIT license as found in the LICENSE file.
Release files for descript-mlx 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| descript_mlx-0.0.2.tar.gz | 11.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| descript_mlx-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.5 kB
Release files / descript_mlx-0.0.2.tar.gz
| Download URL | descript_mlx-0.0.2.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1a5024313bff8cf1bba26b5fb81a2d0da65ec1f06249ecb732346432869050fe
|
|
BLAKE2b-256 checksum How to use checksums |
f4f7674d5825e2f5d822c3c608a380667477a348494e19e42711ccb7545b7dba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|
Release files / descript_mlx-0.0.2-py3-none-any.whl
| Download URL | descript_mlx-0.0.2-py3-none-any.whl |
|---|---|
| Size | 11.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ac6ac83814797b71cd6fcdcc10c0bc32f6a03632a8dda71469a10a4e823a5678
|
|
BLAKE2b-256 checksum How to use checksums |
496aded846da947dec670912058d0485add578e5ca0485a9d80639c32eac243b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|