audiocraft-audio-generation

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

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

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 composition skills, licensed audio libraries, or expensive production tools. This Skill lets you generate music, sound effects, and compressed audio directly from text descriptions using Meta's AudioCraft models. ## 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 from 300M to 3.3B parameters. - Text-to-Sound with AudioGen: Produce sound effects like thunderstorms, traffic, or animal sounds from natural language descriptions. - EnCodec Audio Compression: Encode and decode audio with a neural codec, plus MultiBand Diffusion decoding for higher fidelity output. - Use Case: A game developer needs background music and ambient sound effects for a prototype. They generate a 30-second orchestral loop with MusicGen and batch-produce footsteps, door creaks, and explosion sounds with AudioGen, saving everything as WAV files. ## 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 returned tensor with torchaudio.save at 32000 Hz.

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.

Can I use AudioCraft models through HuggingFace Transformers?

Yes, MusicGen is available in Transformers as MusicgenForConditionalGeneration with 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 or 2GB in FP16, medium needs 8GB/4GB, and large needs 16GB/8GB. Reduce duration or use the small model if you hit CUDA out of memory errors.

Why is my MusicGen output silent or poor quality?

Check the output tensor amplitude and normalize if too quiet. For better quality, use a larger model, increase cfg_coef for stronger text adherence, lower temperature for more focused output, and write 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 and Bark for text-to-speech combined with music or sound effects. AudioCraft fits text-to-music, melody-conditioned generation, and sound effect synthesis up to about 30 seconds.