Skip to main content

Vocos — MLX

Implementation of Vocos with the MLX framework. Vocos allows for high quality reconstruction of audio from Mel spectrograms or EnCodec tokens.

Vocos: Closing the gap between time-domain and Fourier-based neural vocoders for high-quality audio synthesis

Paper [abs] [pdf]

Installation

To use Vocos in inference mode, install it using:

pip install vocos-mlx

Usage

Mel Spectrogram

from vocos_mlx import Vocos, load_audio, log_mel_spectrogram

vocos = Vocos.from_pretrained("lucasnewman/vocos-mel-24khz")

# reconstruct
audio = load_audio("audio.wav", 24_000)
reconstructed_audio = vocos(audio)

# decode from mel spec
mel_spec = log_mel_spectrogram(audio, n_mels = 100)
decoded_audio = vocos.decode(mel_spec)

EnCodec

from vocos_mlx import Vocos, load_audio

vocos = Vocos.from_pretrained("lucasnewman/vocos-encodec-24khz")

# reconstruct
audio = load_audio("audio.wav", 24_000)
reconstructed_audio = vocos(audio, bandwidth_id = 3)

# decode with encodec codes
codes = vocos.get_encodec_codes(audio, bandwidth_id = 3)
decoded_audio = vocos.decode_from_codes(codes, bandwidth_id = 3)

Appreciation

Awni Hannun for the reference EnCodec implementation for MLX.

Citations

@article{siuzdak2023vocos,
  title={Vocos: Closing the gap between time-domain and Fourier-based neural vocoders for high-quality audio synthesis},
  author={Siuzdak, Hubert},
  journal={arXiv preprint arXiv:2306.00814},
  year={2023}
}

License

The code in this repository is released under the MIT license as found in the LICENSE file.

Release files for vocos-mlx 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vocos-mlx 0.0.7
File Size Uploaded
vocos_mlx-0.0.7.tar.gz 14.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vocos-mlx 0.0.7
File Interpreter ABI Platform
vocos_mlx-0.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 29.8 kB

Release files / vocos_mlx-0.0.7.tar.gz

Download URL vocos_mlx-0.0.7.tar.gz
Size 14.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3d556736aaafe23b760befa5f7b639977a3d5c52ad7af65aefe0e636d5541ba3
BLAKE2b-256 checksum
How to use checksums
f1f5fc2149185abe3a65358e96d429f9e00148341f88da52851615fc4c991fd4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release files / vocos_mlx-0.0.7-py3-none-any.whl

Download URL vocos_mlx-0.0.7-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a80ea5961811e982ef82a77b2450ea4cbeb5c47318497acaddbea4b58cbaa8d6
BLAKE2b-256 checksum
How to use checksums
16ecd92a634ba5538d8213c300e2c3429f8f4a512db1012967cbf3ac11f08c01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release history Release notifications | RSS feed

This release

0.0.7 This release

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page