audiocraft-audio-generation

Generate music and sound effects from text prompts using Meta's AudioCraft models.

Updated May 13, 2026
One-click install
npx skills add https://github.com/superfhp/lumi-agent-body --skill audiocraft-audio-generation-superfhp
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: audiocraft-audio-generation
Source: https://github.com/superfhp/lumi-agent-body/tree/main/skills/mlops/models/audiocraft
Command: npx skills add https://github.com/superfhp/lumi-agent-body --skill audiocraft-audio-generation-superfhp

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 lets you generate music, sound effects, and compressed audio directly from text descriptions using Meta's AudioCraft models (MusicGen, AudioGen, EnCodec). ## Core Features & Use Cases - Text-to-Music with MusicGen: Generate music from text prompts with control over duration, temperature, and guidance, including melody-conditioned and stereo variants. - Text-to-Sound with AudioGen: Create sound effects like thunderstorms, traffic, or animal sounds from natural language descriptions. - Audio Compression with EnCodec: Encode and decode audio using a neural codec for high-fidelity compression. - Use Case: A game developer needs background music and ambient sound effects for a new level. They generate a 30-second orchestral track with MusicGen and batch-produce environmental sounds with AudioGen, saving them as WAV files ready for the game engine. ## Quick Start Ask the AI to generate a 15-second upbeat electronic music track from a text description using MusicGen and save it as a WAV file.

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 Meta's AudioCraft library.

Can I use AudioCraft with HuggingFace Transformers?▼

Yes, MusicGen is available in Transformers via MusicgenForConditionalGeneration and AutoProcessor. Note that parameter names differ: use guidance_scale instead of cfg_coef and max_new_tokens instead of duration.

How much GPU memory does MusicGen need?▼

MusicGen-small needs about 4GB VRAM in FP32 (2GB in FP16), medium needs about 8GB (4GB FP16), and large needs about 16GB (8GB FP16). For limited memory, use the small model, reduce duration, or enable half precision.

Why is my MusicGen output silent or poor quality?▼

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

What are the limitations of MusicGen generation length?▼

MusicGen typically generates up to 30 seconds of audio per call. For longer content, generate multiple segments or use audio continuation by passing existing audio as conditioning input through the HuggingFace processor.