audiocraft-audio-generation

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

Updated Jun 7, 2026
One-click install
npx skills add https://github.com/Chensihakniroth/ANAKOT-AGENT --skill audiocraft-audio-generation-chensihakniroth
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: audiocraft-audio-generation
Source: https://github.com/Chensihakniroth/ANAKOT-AGENT/tree/main/skills/mlops/models/audiocraft
Command: npx skills add https://github.com/Chensihakniroth/ANAKOT-AGENT --skill audiocraft-audio-generation-chensihakniroth

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Creating original music tracks or sound effects normally requires audio production skills and licensed content. This Skill lets you generate music from text descriptions with MusicGen, produce sound effects with AudioGen, and compress audio with EnCodec, all through Python code. ## Core Features & Use Cases - Text-to-Music Generation: Use MusicGen models (small 300M to large 3.3B) to create music from text prompts, with melody conditioning, stereo output, and style transfer via MusicGen-Style. - Text-to-Sound Effects: Generate environmental sounds and effects with AudioGen at 16kHz. - Neural Audio Compression: Encode and decode audio with the EnCodec codec for token-based audio pipelines. - Use Case: A game developer needs background music and ambient sound effects. Provide prompts like "epic orchestral soundtrack with strings and brass" and "ocean waves crashing on rocks" to generate WAV files ready for the project. ## Quick Start Install audiocraft with pip and ask the agent to generate a 15-second upbeat electronic music track saved as a WAV file 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 with torchaudio at 32kHz.

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 sound effects and environmental audio from text at 16kHz. Both are part of the AudioCraft library.

Can I use AudioCraft with HuggingFace Transformers?▼

Yes, MusicGen is available in Transformers as MusicgenForConditionalGeneration. Load it with AutoProcessor and generate audio using do_sample, guidance_scale, and max_new_tokens parameters instead of the native AudioCraft API.

How much GPU memory does MusicGen need?▼

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

Why is my generated audio silent or poor quality?▼

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

What are the limitations of MusicGen generation?▼

MusicGen typically generates up to 30 seconds of audio per call, so it is not suited for full-length songs. For longer commercial music, alternatives like Stable Audio are recommended, and Bark is better for speech with music.