music-generation

Générer de la musique d'ambiance de fond en utilisant Lyria via l'API Interactions.

npx skills add https://github.com/google-gemini/gemini-managed-agents-templates --skill music-generation

Music Generation

Generate background music for the radio show using the Lyria model via the Interactions API.

Embedded Script

python3 skills/music-generation/scripts/generate_music.py --workspace ./workspace --mood tech

Arguments

ArgumentDefaultDescription
--workspaceworkspaceRoot workspace directory
--mooddefaultMusic mood (see moods below)

Moods

MoodStylePair with --style
tech (default)Clean synths, electronic pulse, Silicon Valley startup vibeexplainer, debate
chillSoft pads, gentle piano, lo-fi warmthroundtable, explainer
debateBuilding tension, brass-like synths, panel discussion openerdebate, interview

What it does

  1. Selects the music prompt based on --mood.
  2. Calls the Interactions API with the lyria-3-clip-preview model.
  3. Generates a ~30-second music clip.
  4. Saves as MP3 to {workspace}/audio/music/background.mp3.
  5. Gracefully handles failures — the pipeline continues without music.

Dependencies

  • google-genai (>= 2.0.0)

Output

  • File: {workspace}/audio/music/background.mp3
  • Format: MP3
  • Duration: ~30 seconds

Fallback

Lyria is experimental. If generation fails with a policy error or returns no music, the script will attempt to retry once with a simpler fallback prompt: "Create a 30-second simple ambient background track. Instrumental only, calm and neutral."

If the fallback attempt also fails, the pipeline proceeds without background music — the audio-mixing step handles this gracefully.

Plus de skills de google-gemini

agent-tui
google-gemini
Main Agents: Do NOT use this skill directly. If you need to test the TUI, invoke the `tui_tester` subagent. Drive terminal UI (TUI) applications…
gemini-api-cli
google-gemini
Guide pour utiliser l'outil en ligne de commande de l'API Gemini. À utiliser lorsque vous devez interagir avec l'API Gemini via la ligne de commande, gérer des agents ou générer du contenu multimédia (images,…)
behavioral-evals
google-gemini
Conseils pour créer, exécuter, corriger et promouvoir des évaluations comportementales. À utiliser lors de la vérification de la logique de décision d’un agent, du débogage d’échecs, du débogage d’invites…
gemini-live-api-dev
google-gemini
We need to translate the given text from English to French, preserving the name "gemini-live-api-dev" if it appears, but it does not appear in the text. The text is a description of an agent skill. We must not add any extra commentary, labels, or formatting. Just the translation. The text: "Real-time bidirectional streaming with Gemini over WebSockets for audio, video, and text conversations. Supports audio input/output (16 kHz PCM), video frames, text, and automatic transcriptions with voice activity detection for interruption handling Includes native audio features: affective dialog, proactive audio, and thinking mode; function calling for synchronous and asynchronous tool use; and Google Search grounding Offers session management with context compression, resumption, and..." We need to translate this into French. Note: "Gemini" is a product name, keep as is. "WebSockets" is a protocol name, keep as is. "16 kHz PCM" is technical, keep as is. "Google Search" is a product name, keep as is. Also "affective dialog",
gemini-omni-flash-api
google-gemini
Utilisez cette compétence pour le montage vidéo génératif, la conversion texte-vers-vidéo, la génération vidéo avec référence d'image, et les animations de transition de première image vers vidéo en utilisant le…
gemini-api-dev
google-gemini
Développez des applications avec les modèles Gemini de Google, prenant en charge le contenu multimodal, l'appel de fonctions et les sorties structurées en Python, JavaScript, Go et Java. Accédez aux modèles actuels Gemini 3 (Pro, Flash, Pro Image) avec un contexte de 1 million de tokens ; les modèles hérités Gemini 2.x et 1.5 sont obsolètes. Prend en charge la génération de texte, la compréhension d'images/audio/vidéo, l'appel de fonctions, la sortie JSON structurée, l'exécution de code, la mise en cache de contexte et les embeddings. Kits SDK officiels disponibles : google-genai (Python),...
gemini-interactions-api
google-gemini
Interface unifié pour les modèles et agents Gemini avec état côté serveur, streaming et orchestration d'outils. Prend en charge plusieurs modèles actuels (gemini-3-flash-preview, gemini-3-pro-preview, gemini-2.5-flash/pro) et l'agent Deep Research ; remplace automatiquement les ID de modèles obsolètes par des alternatives actuelles. Déchargez l'historique des conversations sur le serveur via previous_interaction_id pour des interactions multi-tours avec état sans gestion manuelle de l'historique. Orchestration d'outils intégrée incluant...
deliver
google-gemini
Publie une version condensée du briefing vers un webhook entrant Google Chat ou Slack, afin que le run quotidien se livre tout seul — passe silencieusement lorsqu'aucun webhook n'est…