audiocraft-audio-generation

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

5|2|Updated May 26, 2026
One-click install
npx skills add https://github.com/perasyudha/Nyxora --skill audiocraft-audio-generation-perasyudha
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: audiocraft-audio-generation
Source: https://github.com/perasyudha/Nyxora/tree/main/packages/core/playbooks/mlops/models/audiocraft
Command: npx skills add https://github.com/perasyudha/Nyxora --skill audiocraft-audio-generation-perasyudha

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Creating original music 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 melody conditioning, stereo output, and style transfer across model sizes from 300M to 3.3B parameters. - Text-to-Sound with AudioGen: Create sound effects and environmental audio like thunderstorms, traffic, or footsteps from natural language descriptions. - Audio Compression with EnCodec: Encode and decode audio using a high-fidelity neural codec for efficient storage and streaming. - Use Case: Build a Gradio demo or FastAPI service where users type "epic orchestral soundtrack with strings and brass" and receive a 30-second WAV file generated on GPU. ## Quick Start Install audiocraft with pip, load the facebook/musicgen-small model, set a generation duration, and call model.generate with a text description to produce a WAV audio 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 32000 Hz 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 sound effects and environmental audio like rain or traffic at 16kHz. Both use the same text-to-audio transformer architecture.

Can I use AudioCraft models through HuggingFace Transformers?

Yes, MusicGen is available in Transformers as MusicgenForConditionalGeneration with AutoProcessor. Use guidance_scale instead of cfg_coef and max_new_tokens instead of duration, roughly 50 tokens per second of audio.

How much GPU memory does MusicGen need?

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

Why is my MusicGen output silent or poor quality?

Silent output usually means the audio needs normalization to a target loudness. Poor quality improves with a larger model, higher cfg_coef for stronger text adherence, lower temperature, and more specific prompts describing genre, instruments, and tempo.

When should I use Stable Audio or Bark instead of AudioCraft?

Use Stable Audio for longer commercial music generation beyond MusicGen's typical 30-second limit. Use Bark for text-to-speech combined with music and sound effects. AudioCraft fits text-to-music, melody conditioning, and sound effect generation.