audiocraft-audio-generation

Generate music and sound effects from text prompts using AudioCraft MusicGen and AudioGen models.

Updated Jul 3, 2026
One-click install
npx skills add https://github.com/CHENHUI-X/toolbox --skill audiocraft-audio-generation-chenhui-x
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: audiocraft-audio-generation
Source: https://github.com/CHENHUI-X/toolbox/tree/main/custom-skills/models/audiocraft
Command: npx skills add https://github.com/CHENHUI-X/toolbox --skill audiocraft-audio-generation-chenhui-x

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires audiocraft, torch, transformers, and includes references (resource) components.

What problem does it solve? Creating original music tracks and sound effects traditionally requires audio production expertise and expensive tools. This Skill enables programmatic text-to-music and text-to-sound generation using Meta's AudioCraft models, covering everything from quick prototypes to production pipelines. ## Core Features & Use Cases - Text-to-Music with MusicGen: Generate music from text descriptions with control over duration, temperature, and guidance, including melody-conditioned and stereo variants. - Text-to-Sound with AudioGen: Produce sound effects and environmental audio like thunderstorms, traffic, or footsteps from natural language prompts. - EnCodec Compression: Encode and decode audio with a high-fidelity neural codec for token-based audio processing. - Use Case: A game developer needs background music and ambient sound effects. Use MusicGen to generate a 30-second orchestral loop and AudioGen to batch-produce footsteps, door creaks, and explosion sounds, saving each as WAV files. ## Quick Start Install audiocraft with pip and ask the AI to generate a 10-second upbeat electronic music track from a text description using MusicGen.

Frequently Asked Questions about audiocraft-audio-generation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate music from text with MusicGen?

Load a pretrained model with MusicGen.get_pretrained('facebook/musicgen-small'), set generation parameters like duration and temperature, then call model.generate() with a list of text descriptions. Save the output tensor as a WAV file at 32kHz using torchaudio.

What is the difference between MusicGen and AudioGen?

MusicGen generates music from text prompts and supports melody conditioning and stereo output at 32kHz. AudioGen generates environmental sounds and sound effects from text at 16kHz. Both are part of the AudioCraft library but use different pretrained checkpoints.

Can I use AudioCraft models through HuggingFace Transformers?

Yes, MusicGen is available in Transformers as MusicgenForConditionalGeneration with AutoProcessor. Load facebook/musicgen-small, process text inputs, and call generate with parameters like guidance_scale and max_new_tokens instead of AudioCraft's native API.

How much GPU memory does MusicGen need?

MusicGen-small requires about 4GB VRAM in FP32 or 2GB in FP16, medium needs 8GB/4GB, and large needs 16GB/8GB. Reduce generation duration or use the small model if you encounter CUDA out-of-memory errors.

Why is my MusicGen output silent or poor quality?

Silent output usually requires normalizing the audio amplitude, while poor quality improves with a larger model, higher cfg_coef for text adherence, lower temperature, and more specific prompts describing genre, instruments, and tempo.

When should I use alternatives to AudioCraft?

Consider Stable Audio for longer commercial music generation, Bark for text-to-speech combined with music and sound effects, or Riffusion for spectrogram-based music generation. AudioCraft targets controllable text-to-music and text-to-sound tasks up to about 30 seconds.