facebook / encodec_32khz

huggingface.co
Total runs: 41.6K
24-hour runs: 0
7-day runs: -1.1K
30-day runs: -704
Model's Last Updated: September 05 2023
feature-extraction

Introduction of encodec_32khz

Model Details of encodec_32khz

encodec image

Model Card for EnCodec

This model card provides details and information about EnCodec 32kHz, a state-of-the-art real-time audio codec developed by Meta AI. This EnCodec checkpoint was trained specifically as part of the MusicGen project , and is intended to be used in conjuction with the MusicGen models.

Model Details
Model Description

EnCodec is a high-fidelity audio codec leveraging neural networks. It introduces a streaming encoder-decoder architecture with quantized latent space, trained in an end-to-end fashion. The model simplifies and speeds up training using a single multiscale spectrogram adversary that efficiently reduces artifacts and produces high-quality samples. It also includes a novel loss balancer mechanism that stabilizes training by decoupling the choice of hyperparameters from the typical scale of the loss. Additionally, lightweight Transformer models are used to further compress the obtained representation while maintaining real-time performance. This variant of EnCodec is trained on 20k of music data, consisting of an internal dataset of 10K high-quality music tracks, and on the ShutterStock and Pond5 music datasets.

  • Developed by: Meta AI
  • Model type: Audio Codec
Model Sources
Uses
Direct Use

EnCodec can be used directly as an audio codec for real-time compression and decompression of audio signals. It provides high-quality audio compression and efficient decoding. The model was trained on various bandwiths, which can be specified when encoding (compressing) and decoding (decompressing). Two different setup exist for EnCodec:

  • Non-streamable: the input audio is split into chunks of 1 seconds, with an overlap of 10 ms, which are then encoded.
  • Streamable: weight normalizationis used on the convolution layers, and the input is not split into chunks but rather padded on the left.
Downstream Use

This variant of EnCodec is designed to be used in conjunction with the official MusicGen checkpoints . However, it can also be used standalone to encode audio files.

How to Get Started with the Model

Use the following code to get started with the EnCodec model using a dummy example from the LibriSpeech dataset (~9MB). First, install the required Python packages:

pip install --upgrade pip
pip install --upgrade transformers datasets[audio] 

Then load an audio sample, and run a forward pass of the model:

from datasets import load_dataset, Audio
from transformers import EncodecModel, AutoProcessor


# load a demonstration datasets
librispeech_dummy = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")

# load the model + processor (for pre-processing the audio)
model = EncodecModel.from_pretrained("facebook/encodec_48khz")
processor = AutoProcessor.from_pretrained("facebook/encodec_48khz")

# cast the audio data to the correct sampling rate for the model
librispeech_dummy = librispeech_dummy.cast_column("audio", Audio(sampling_rate=processor.sampling_rate))
audio_sample = librispeech_dummy[0]["audio"]["array"]

# pre-process the inputs
inputs = processor(raw_audio=audio_sample, sampling_rate=processor.sampling_rate, return_tensors="pt")

# explicitly encode then decode the audio inputs
encoder_outputs = model.encode(inputs["input_values"], inputs["padding_mask"])
audio_values = model.decode(encoder_outputs.audio_codes, encoder_outputs.audio_scales, inputs["padding_mask"])[0]

# or the equivalent with a forward pass
audio_values = model(inputs["input_values"], inputs["padding_mask"]).audio_values
Evaluation

For evaluation results, refer to the MusicGen evaluation scores .

Summary

EnCodec is a state-of-the-art real-time neural audio compression model that excels in producing high-fidelity audio samples at various sample rates and bandwidths. The model's performance was evaluated across different settings, ranging from 24kHz monophonic at 1.5 kbps to 48kHz stereophonic, showcasing both subjective and objective results. Notably, EnCodec incorporates a novel spectrogram-only adversarial loss, effectively reducing artifacts and enhancing sample quality. Training stability and interpretability were further enhanced through the introduction of a gradient balancer for the loss weights. Additionally, the study demonstrated that a compact Transformer model can be employed to achieve an additional bandwidth reduction of up to 40% without compromising quality, particularly in applications where low latency is not critical (e.g., music streaming).

Citation

BibTeX:

@misc{copet2023simple,
      title={Simple and Controllable Music Generation}, 
      author={Jade Copet and Felix Kreuk and Itai Gat and Tal Remez and David Kant and Gabriel Synnaeve and Yossi Adi and Alexandre Défossez},
      year={2023},
      eprint={2306.05284},
      archivePrefix={arXiv},
      primaryClass={cs.SD}
}

Runs of facebook encodec_32khz on huggingface.co

41.6K
Total runs
0
24-hour runs
-155
3-day runs
-1.1K
7-day runs
-704
30-day runs

More Information About encodec_32khz huggingface.co Model

encodec_32khz huggingface.co

encodec_32khz huggingface.co is an AI model on huggingface.co that provides encodec_32khz's model effect (), which can be used instantly with this facebook encodec_32khz model. huggingface.co supports a free trial of the encodec_32khz model, and also provides paid use of the encodec_32khz. Support call encodec_32khz model through api, including Node.js, Python, http.

encodec_32khz huggingface.co Url

https://huggingface.co/facebook/encodec_32khz

facebook encodec_32khz online free

encodec_32khz huggingface.co is an online trial and call api platform, which integrates encodec_32khz's modeling effects, including api services, and provides a free online trial of encodec_32khz, you can try encodec_32khz online for free by clicking the link below.

facebook encodec_32khz online free url in huggingface.co:

https://huggingface.co/facebook/encodec_32khz

encodec_32khz install

encodec_32khz is an open source model from GitHub that offers a free installation service, and any user can find encodec_32khz on GitHub to install. At the same time, huggingface.co provides the effect of encodec_32khz install, users can directly use encodec_32khz installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

encodec_32khz install url in huggingface.co:

https://huggingface.co/facebook/encodec_32khz

Url of encodec_32khz

encodec_32khz huggingface.co Url

Provider of encodec_32khz huggingface.co

facebook
ORGANIZATIONS

Other API from facebook

huggingface.co

Total runs: 8.1M
Run Growth: 223.4K
Growth Rate: 2.76%
Updated:January 20 2022
huggingface.co

Total runs: 6.9M
Run Growth: -3.5M
Growth Rate: -50.43%
Updated:September 15 2023
huggingface.co

Total runs: 2.8M
Run Growth: -1.6M
Growth Rate: -57.59%
Updated:September 06 2023
huggingface.co

Total runs: 2.8M
Run Growth: -64.6K
Growth Rate: -2.30%
Updated:January 17 2024
huggingface.co

Total runs: 2.2M
Run Growth: -1.1M
Growth Rate: -48.19%
Updated:December 28 2021
huggingface.co

Total runs: 2.1M
Run Growth: -154.1K
Growth Rate: -7.26%
Updated:November 21 2025
huggingface.co

Total runs: 2.0M
Run Growth: 135.9K
Growth Rate: 7.10%
Updated:March 23 2023
huggingface.co

Total runs: 1.8M
Run Growth: -532.4K
Growth Rate: -29.21%
Updated:January 25 2024
huggingface.co

Total runs: 922.5K
Run Growth: 140.9K
Growth Rate: 15.27%
Updated:September 06 2023
huggingface.co

Total runs: 465.6K
Run Growth: 41.2K
Growth Rate: 8.85%
Updated:March 17 2025
huggingface.co

Total runs: 460.7K
Run Growth: -58.7K
Growth Rate: -12.74%
Updated:May 22 2023
huggingface.co

Total runs: 451.4K
Run Growth: 54.9K
Growth Rate: 12.16%
Updated:February 29 2024
huggingface.co

Total runs: 328.1K
Run Growth: -39.1K
Growth Rate: -11.92%
Updated:January 12 2024
huggingface.co

Total runs: 310.4K
Run Growth: 37.1K
Growth Rate: 11.95%
Updated:September 06 2023
huggingface.co

Total runs: 293.8K
Run Growth: 101.3K
Growth Rate: 34.47%
Updated:September 15 2023
huggingface.co

Total runs: 289.7K
Run Growth: -24.8K
Growth Rate: -8.55%
Updated:November 17 2022
huggingface.co

Total runs: 274.9K
Run Growth: 19.8K
Growth Rate: 7.22%
Updated:June 15 2023
huggingface.co

Total runs: 247.2K
Run Growth: -299.1K
Growth Rate: -120.99%
Updated:January 12 2024
huggingface.co

Total runs: 236.9K
Run Growth: 14.3K
Growth Rate: 6.02%
Updated:July 23 2024
huggingface.co

Total runs: 204.1K
Run Growth: 73.4K
Growth Rate: 35.97%
Updated:June 13 2023
huggingface.co

Total runs: 169.9K
Run Growth: 10.5K
Growth Rate: 6.19%
Updated:February 12 2023
huggingface.co

Total runs: 161.0K
Run Growth: 1.7K
Growth Rate: 1.05%
Updated:September 01 2023
huggingface.co

Total runs: 124.3K
Run Growth: -30.1K
Growth Rate: -24.19%
Updated:September 06 2023
huggingface.co

Total runs: 117.1K
Run Growth: -14.4K
Growth Rate: -12.33%
Updated:June 03 2022
huggingface.co

Total runs: 105.2K
Run Growth: -108.3K
Growth Rate: -102.94%
Updated:July 25 2023
huggingface.co

Total runs: 98.8K
Run Growth: 68.9K
Growth Rate: 69.73%
Updated:February 12 2023
huggingface.co

Total runs: 97.8K
Run Growth: -157.7K
Growth Rate: -161.34%
Updated:May 22 2023
huggingface.co

Total runs: 97.4K
Run Growth: -25.8K
Growth Rate: -26.52%
Updated:November 16 2023
huggingface.co

Total runs: 90.6K
Run Growth: -127
Growth Rate: -0.14%
Updated:January 25 2023
huggingface.co

Total runs: 89.2K
Run Growth: -18.1K
Growth Rate: -20.30%
Updated:September 15 2023
huggingface.co

Total runs: 85.4K
Run Growth: -4.3K
Growth Rate: -5.07%
Updated:November 20 2023
huggingface.co

Total runs: 78.8K
Run Growth: -62.7K
Growth Rate: -79.57%
Updated:June 13 2023
huggingface.co

Total runs: 53.4K
Run Growth: 28.4K
Growth Rate: 53.11%
Updated:December 09 2025
huggingface.co

Total runs: 51.5K
Run Growth: -18.0K
Growth Rate: -34.93%
Updated:March 28 2026