multimodal-audiocraft
What it does
This skill helps your AI use AudioCraft, a set of Meta tools for creating audio. It is for creators who want background music or sound effects made from a written description.
When to use it
- βWhen you want to generate a music track from a text description of its style and mood.
- βWhen you need sound effects or environmental audio made from a short description.
- βWhen you want to shape a new piece of music using a melody you provide.
Skill link
https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/ai-research/multimodal-audiocraft/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βCan you help me create a 20-second ambient music track for a short video?β
5 new skills a week. 1 minute to read.
How it works
The skill shows how to install AudioCraft and choose a model such as MusicGen or AudioGen. You write a text prompt, and the model produces an audio file.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
AudioCraft: Audio Generation
Comprehensive guide to using Meta's AudioCraft for text-to-music and text-to-audio generation with MusicGen, AudioGen, and EnCodec.
When to use AudioCraft
Use AudioCraft when:
- Need to generate music from text descriptions
- Creating sound effects and environmental audio
- Building music generation applications
- Need melody-conditioned music generation
- Want stereo audio output
- Require controllable music generation with style transfer
Key features:
- MusicGen: Text-to-music generation with melody conditioning
- AudioGen: Text-to-sound effects generation
- EnCodec: High-fidelity neural audio codec
- Multiple model sizes: Small (300M) to Large (3.3B)
- Stereo support: Full stereo audio generation
- Style conditioning: MusicGen-Style for reference-based generation
Use alternatives instead:
- Stable Audio: For longer commercial music generation
- Bark: For text-to-speech with music/sound effects
- Riffusion: For spectogram-based music generation
- OpenAI Jukebox: For raw audio generation with lyrics
Quick start
Installation
# From PyPI
pip install audiocraft
# From GitHub (latest)
pip install git+https://github.com/facebookresearch/audiocraft.git
# Or use HuggingFace Transformers
pip install transformers torch torchaudio
Basic text-to-music (AudioCraft)
import torchaudio
from audiocraft.models import MusicGen
# Load model
model = MusicGen.get_pretrained('facebook/musicgen-small')
# Set generation parameters
model.set_generation_params(
duration=8, # seconds
top_k=250,
temperature=1.0
)
# Generate from text
descriptions = ["happy upbeat electronic dance music with synths"]
wav = model.generate(descriptions)
# Save audio
torchaudio.save("output.wav", wav[0].cpu(), sample_rate=32000)
Using HuggingFace Transformers
from transformers import AutoProcessor, MusicgenForConditionalGeneration
import scipy
# Load model and processor
processor = AutoProcessor.from_pretrained("facebook/musicgen-small")
model = MusicgenForConditionalGeneration.from_pretrained("facebook/musicgen-small")
model.to("cuda")
# Generate music
inputs = processor(
text=["80s pop track with bassy drums and synth"],
padding=True,
return_tensors="pt"
).to("cuda")
audio_values = model.generate(
**inputs,
do_sample=True,
guidance_scale=3,
max_new_tokens=256
)
# Save
sampling_rate = model.config.audio_encoder.sampling_rate
scipy.io.wavfile.write("output.wav", rate=sampling_rate, data=audio_values[0, 0].cpu().numpy())
Text-to-sound with AudioGen
from audiocraft.models import AudioGen
# Load AudioGen
model = AudioGen.get_pretrained('facebook/audiogen-medium')
model.set_generation_params(duration=5)
# Generate sound effects
descriptions = ["dog barking in a park with birds chirping"]
wav = model.generate(descriptions)
torchaudio.save("sound.wav", wav[0].cpu(), sample_rate=16000)
Core concepts
Architecture overview
AudioCraft Architecture:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Text Encoder (T5) β
β β β
β Text Embeddings β
ββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββ
β Transformer Decoder (LM) β
β Auto-regressively generates audio tokens β
β Using efficient token interleaving patterns β
ββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββ
β EnCodec Audio Decoder β
β Converts tokens back to audio waveform β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Model variants
| Model | Size | Description | Use Case |
|---|---|---|---|
musicgen-small |
300M | Text-to-music | Quick generation |
musicgen-medium |
1.5B | Text-to-music | Balanced |
musicgen-large |
3.3B | Text-to-music | Best quality |
musicgen-melody |
1.5B | Text + melody | Melody conditioning |
musicgen-melody-large |
3.3B | Text + melody | Best melody |
musicgen-stereo-* |
FAQ
What is the difference between MusicGen and AudioGen?
MusicGen makes music from text and can use a melody, while AudioGen makes sound effects from text.
Can the output be stereo?
Yes. The guidance says MusicGen supports full stereo output.
Are there alternatives?
The guidance mentions Stable Audio for longer commercial tracks and Bark for speech with music or sound effects.
Details
Original description by the author
PyTorch library for audio generation including text-to-music (MusicGen) and text-to-sound (AudioGen). Use when you need to generate music from text descriptions, create sound effects, or perform melody-conditioned music generation.
Popularity
- GitHub stars
- 33k
- Ranking position
- #8586
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
owasp-security
33kTeaches your agent OWASP security guidance for web apps, APIs, mobile, containers and AI agents, so it can spot common weaknesses and suggest fixes.
agent-management
33kLets your agent create, list, hibernate, wake, rename and delete AI agents using the AI Maestro command line, managing each agent's lifecycle.
agent-messaging
33kLets your agent send, receive and reply to signed messages between AI agents, using the Agent Messaging Protocol, mostly on your own machine.
docs-search
33kLets your agent search auto-generated code documentation for function signatures, class definitions and comments, so it checks the real API before changing code.
Similar skills
openai-whisper-api
394kLets your agent turn an audio recording into text using OpenAI's transcription service, with options for speaker labels and output files.
openai-whisper
394kHelps your agent transcribe audio on your own computer with the Whisper command, with no API key and no cloud upload needed.
sag
394kHelps your agent read text aloud with ElevenLabs voices and play the result on your computer, with tips for pronunciation and expression.