Guide · Agent skill
How to use the AudioCraft Audio Generation agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The audiocraft-audio-generation skill gives your AI agent a working guide to Meta's AudioCraft library, which generates music (MusicGen) and sound effects (AudioGen) from written descriptions. It is written for people who have never used agent skills, so this page covers what the skill does, how to install it, how to ask for it, and what your machine needs. By the end you will be able to ask an agent for a short audio clip and get a WAV file back.
Quick start
- 1Download and unzip the skill. Download the ZIP from this page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder.
- 2Or upload it in the Claude apps. Open Settings, go to Capabilities, choose Skills and upload the skill.
- 3Prepare Python and GPU. Install PyTorch 2.0 or newer and either the audiocraft package or transformers with torch and torchaudio. A GPU is recommended.
- 4Ask in plain language. Describe the music or sound you want, including style, mood, instruments and length.
- 5Review and run the code. Check the Python the agent writes, then let it run. Model weights download from HuggingFace on first use.
- 6Listen and iterate. Open the saved WAV file, then adjust the description, duration or model size and generate again.
What the skill makes the agent do
Agent skills are folders of instructions and reference files that an AI agent loads when a task matches them. This one is built around SKILL.md, which teaches the agent how to write and run Python code that uses AudioCraft. Given a text description such as 'chill lo-fi hip hop beat', the agent can produce an audio file.
The skill covers text-to-music with MusicGen, text-to-sound with AudioGen, melody-conditioned music, stereo output, and using the same models through HuggingFace Transformers. It is a reference guide, so it sets up the correct code, model choices and generation settings rather than providing a finished app.
- MusicGen: text-to-music, including melody conditioning
- AudioGen: text-to-sound effects
- Stereo output with the stereo model variants
- Model choice from small (300M parameters) to large (3.3B parameters)
Install the skill (ZIP download or Claude apps)
Download the skill ZIP from this page and unzip it. For a personal setup, place the unzipped folder in ~/.claude/skills/. For a single project, place it in that project's .claude/skills/ folder instead.
If you use the Claude apps, you can upload the skill instead. Open Settings, go to Capabilities, then choose Skills and upload the skill there.
- Personal install: ~/.claude/skills/audiocraft-audio-generation
- Project install: .claude/skills/audiocraft-audio-generation inside your project
- Claude apps: Settings → Capabilities → Skills
Set up your Python environment
The skill's examples need the audiocraft package, or the HuggingFace Transformers route with torch and torchaudio. The source lists PyTorch 2.0 or newer and transformers 4.30 or newer. The examples move models to CUDA, so a GPU is strongly recommended. Model weights are downloaded from HuggingFace the first time you load a model, so you need network access.
If you prefer to install by hand before asking the agent, the source gives these commands.
- Requires a Python environment
- Requires PyTorch 2.0+ and transformers 4.30+
- Model weights come from HuggingFace (facebook/musicgen-*, facebook/audiogen-*)
pip install audiocraft
# Or use HuggingFace Transformers
pip install transformers torch torchaudioTrigger the skill with natural requests
You do not need special syntax. The skill's description says to use it when you need to generate music from text, create sound effects, or perform melody-conditioned music generation, so ask for those things directly in plain language and name the output you want.
Be specific about style, mood, instruments and length. The examples in the skill use descriptions like 'happy upbeat electronic dance music with synths' and 'dog barking in a park with birds chirping'.
- "Generate an 8-second chill lo-fi hip hop beat with jazzy piano and save it as a WAV."
- "Make a sound effect of a dog barking in a park with birds chirping, about 5 seconds."
- "Create a 30-second folk song conditioned on my melody.wav, with an acoustic guitar."
Examples of what you can ask for
Text-to-music with MusicGen generates several clips from a list of descriptions in one call, saving each as a WAV file. Melody conditioning uses the musicgen-melody model together with an audio file you supply. Stereo generation uses a stereo model and returns an array with two channels.
The skill also shows audio continuation with the Transformers route, where you pass an existing clip and a text prompt, such as continuing an intro with an epic chorus.
- Background music for a video or podcast placeholder
- Ambient sound effects for a game scene
- Music prototypes for an app feature
from audiocraft.models import MusicGen
import torchaudio
model = MusicGen.get_pretrained('facebook/musicgen-small')
model.set_generation_params(duration=8)
wav = model.generate(["chill lo-fi hip hop beat"])
torchaudio.save("output.wav", wav[0].cpu(), sample_rate=32000)Safety notes: scripts and network use
This skill runs scripts and uses the network. The agent writes and executes Python code on your machine, and model weights are downloaded from HuggingFace. Review the code the agent proposes before running it, especially on a machine with sensitive files.
The skill does not address usage rights for generated audio. If you plan a commercial release, check the licence of the model and your use case yourself.
- Runs scripts: the agent executes Python code locally
- Uses network: model weights download from HuggingFace
- Check licensing before commercial use
Tips for better results
Model size is a trade-off. The skill lists musicgen-small as the quick option and musicgen-large as best quality, with larger models needing more memory. Duration affects time as well as length, so test with short clips first.
If setup fails, the skill's troubleshooting reference covers common errors such as a missing audiocraft module, FFmpeg not found, and CUDA mismatches.
- Start with musicgen-small and an 8-second duration to test
- Use the stereo variants when you need two-channel output
- Use the melody model when you want the tune to follow a reference file
- Use the troubleshooting reference for ModuleNotFoundError, ffmpeg errors and CUDA issues
What people use it for
- Placeholder background music for a video or podcast edit
- Quick ambient sound effects for a game or film scene, such as a dog barking in a park
- Melody-conditioned folk or acoustic sketches built from a reference clip
- Adding a music or sound-effect generation feature to a developer's app
Frequently asked questions
How do I install the AudioCraft agent skill?
Download the skill ZIP from this page and unzip it into ~/.claude/skills/ for personal use or a project's .claude/skills/ folder for one project. In the Claude apps, you can instead upload it under Settings → Capabilities → Skills.
What do I need to run AudioCraft?
The source requires a Python environment, the audiocraft package or transformers with torch and torchaudio, PyTorch 2.0 or newer, and transformers 4.30 or newer. A GPU is recommended because the examples move models to cuda, and model weights download from HuggingFace.
Is the AudioCraft skill free and what is its licence?
The skill is listed under the MIT licence. The skill page does not state prices for the models, so check the licence of each model weight you download from HuggingFace.
Can AudioCraft make music for a commercial release?
The skill points to Stable Audio for longer commercial music and does not address usage rights for generated audio. Check the rights yourself before using output in a commercial release.
What are the alternatives to AudioCraft?
The skill lists Stable Audio for longer commercial music, Bark for text-to-speech with music or sound effects, Riffusion for spectrogram-based music, and OpenAI Jukebox for raw audio with lyrics.
Why does my AudioCraft install fail with ModuleNotFoundError or ffmpeg errors?
The skill's troubleshooting reference covers these cases. Reinstall with pip install audiocraft, verify with a short import test, install FFmpeg for your system, and match the PyTorch build to your CUDA version.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use this skill if you want an agent to generate placeholder music or quick sound effects from text, and you have a Python setup with a GPU. Pick something else if you need vocals or lyrics, clearly licensed commercial output, or you cannot run large models locally.
Download the skill