Descript Audio Codec — MLX
This model is reshaped for MLX from the original weights and is designed for use with descript-mlx
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("24khz")
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")