Meta AudioCraft
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).
python -m pip install 'torch==2.1.0'python -m pip install setuptools wheelpython -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 modelWe also recommend having ffmpeg installed, either through your system or Anaconda:
sudo apt-get install ffmpegconda 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
🤖 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.