Meta AudioCraft

Voice & Multimodal 💻 Jupyter Notebook ⚖️ MIT 🔴 No recent commits
23.6k stars

AudioCraft is a PyTorch library for deep learning research on audio generation, providing training and inference code for state-of-the-art models like MusicGen and AudioGen. It solves the problem of generating high-quality audio from text descriptions, and is intended for researchers and developers working on audio generation.

✨ Key features

  • State-of-the-art models: MusicGen, AudioGen, EnCodec, and more.
  • Training code for developing and reproducing audio models.
  • Inference code for generating audio from text.
  • Supports text-to-music and text-to-sound generation.
  • Includes audio watermarking with AudioSeal.
  • Compatible with PyTorch 2.1.0 and Python 3.9.

🎯 Use cases

  • Generate music from text descriptions.
  • Generate sound effects from text prompts.
  • Train custom audio generation models.
  • Research on audio compression and generation.
  • Add audio watermarking to generated audio.

📦 Installation

🧰 Requirements: Requires Python 3.9, PyTorch 2.1.0, and ffmpeg (recommended).

Best to make sure you have torch installed first, in particular before installing xformers. · Don't run this if you already have PyTorch installed.
python -m pip install 'torch==2.1.0'
You might need the following before trying to install the packages
python -m pip install setuptools wheel
Then proceed to one of the following
python -m pip install -U audiocraft  # stable release
python -m pip install -U git+https://git@github.com/facebookresearch/audiocraft#egg=audiocraft  # bleeding edge
python -m pip install -e .  # or if you cloned the repo locally (mandatory if you want to train).
python -m pip install -e '.[wm]'  # if you want to train a watermarking model

We also recommend having ffmpeg installed, either through your system or Anaconda:

sudo apt-get install ffmpeg
Or if you are using Anaconda or Miniconda
conda install "ffmpeg<5" -c conda-forge

🚀 Usage

from audiocraft.models import MusicGen
model = MusicGen.get_pretrained('facebook/musicgen-small')
model.set_generation_params(duration=8)
wav = model.generate(['happy rock music'])

⚠️ Good to know

The model weights are released under CC-BY-NC 4.0, which restricts commercial use.

❓ FAQ

Is the training code available?

Yes, training code is provided for EnCodec, MusicGen, Multi Band Diffusion, and JASCO.

Where are the models stored?

Models are stored on Hugging Face, and the cache location can be overridden by setting the AUDIOCRAFT_CACHE_DIR environment variable.

What is the license for the code and weights?

The code is under MIT license, while the model weights are under CC-BY-NC 4.0.

📊 Repository

Stars★ 23,609
Forks🍴 2,697
Open issues🐛 396
Last commit🕒 Mar 3, 2026
Created📅 Jun 2023
Language💻 Jupyter Notebook
License⚖️ MIT

🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.