
AudioCraft
A PyTorch library for researching and running AI audio and music generation models.
- Stars
- 23.8k
- Forks
- 2.7k
- Licence
- MIT
- Language
- Jupyter Notebook
- Last update
- 8 months ago
- Type
- Library
What it is
AudioCraft is a PyTorch library from Meta's research team for generating audio with deep learning. It bundles inference and training code for models such as MusicGen (text-to-music), AudioGen (text-to-sound), and the EnCodec audio codec. People use it to experiment with generating music or sound from text prompts, or to train their own audio models.
- Generate short music clips from a text prompt using MusicGen
- Generate sound effects or ambient audio from a text prompt using AudioGen
- Compress and decode audio with the EnCodec neural codec
- Train or fine-tune a model using the training pipelines described in the docs
Great for
- Researchers who want working code for text-to-music or text-to-sound models
- Developers who are comfortable with Python and PyTorch and want to build audio generation into a project
- Students learning how neural audio codecs and generative audio models work
- Anyone experimenting with generating short music or sound clips from text descriptions
Not ideal for
- People who want a finished point-and-click music app: the README describes a library, not a consumer product
- Commercial projects needing to use the pretrained model weights: they are released under CC-BY-NC 4.0, which restricts non-commercial use, while only the code is MIT-licensed
- Users without Python or GPU experience, since installation requires PyTorch and specific versions
How to get it
- 1
Install with a package manager
You'll need: Python 3.9 · PyTorch 2.1.0 · ffmpeg (recommended)
Install PyTorch 2.1.0
python -m pip install 'torch==2.1.0'Install setuptools and wheel
python -m pip install setuptools wheelInstall the stable AudioCraft release
python -m pip install -U audiocraftInstall ffmpeg on Debian/Ubuntu
sudo apt-get install ffmpeg - 2
Run it
- Install Python 3.9, PyTorch 2.1.0, and ffmpeg as described in the README
- Install the audiocraft package with pip
- Open the MusicGen documentation (docs/MUSICGEN.md) for model usage instructions
- Load a pretrained model and pass a text prompt to generate audio
- 3
Get the most out of it
- Set the AUDIOCRAFT_CACHE_DIR environment variable to control where model weights are stored
- Read the model-specific docs (MusicGen, AudioGen, MAGNeT, JASCO) for conditioning options such as melody or chord input
- Use the AudioSeal watermarking documentation if you need to mark generated audio
- Follow the training documentation if you want to build your own training pipeline
Downloads
Strengths
- Bundles several models (MusicGen, AudioGen, EnCodec, MAGNeT, AudioSeal and others) under one library
- Code is released under the MIT license and the project is actively maintained by Meta's research team
- Includes training code and documentation for several of its models, not only inference
Trade-offs
- Pretrained model weights use a non-commercial license (CC-BY-NC 4.0), which limits commercial use
- Requires specific versions (Python 3.9, PyTorch 2.1.0 per the README), which can complicate setup
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| audiocraft (this) | 23.8k | Library | intermediate | 8 months ago | Researchers who want working code for text-to-music or text-to-sound models |
| bark | 39.3k | AI model / agent | intermediate | 2.2 years ago | Developers who want to add text-to-speech or sound generation to a Python project |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.