Overview
Instrumental music / BGM generation (no vocals, no lyrics), supporting multiple styles (jazz/classical/electronic/piano/ambient, etc.) and precise duration control (30–120 seconds). It leans toward ambient/铺垫/background instrumental music, and is not responsible for strong rhythm, strong variation, or complete song structure.
Before execution, the user should be clearly informed that: this Skill will use Meitu OpenAPI credentials, call the local meitu CLI, send the generation request to the Meitu OpenAPI, and write the generated audio file to ./output/ or $VISUAL/output/audio-music-generate/。
API Mapping
- Instrumental music / BGM generation:
audio_peanut_generate
Dependencies
- meitu-cli:
>=2.0.6 - Credentials:CONFIG AKSK →
meitu tools update; EXEC AKSK → actual execution (see rootCONFIG.md) - Environment variables:
MEITU_OPENAPI_TOOL_TASK_MODE=command
Path alias:
$VISUAL={OPENCLAW_HOME}/workspace/visual/
Core Workflow
Preflight → Execute → Deliver
Preflight
meitu --version≥ 2.0.6- Already ran with CONFIG AKSK
meitu tools update - Current AKSK = EXEC,
MEITU_OPENAPI_TOOL_TASK_MODE=command - output_dir:openclaw.yaml →
./output/|else →$VISUAL/output/audio-music-generate/;mkdir -p
Execute
Trigger signals / routing rules
Core dimensions:Instrumental music scenario hit + complete parameters。
| Scenario | Judgment keywords | Routing |
|---|---|---|
| Instrumental music / BGM / background music | Explicitly request generation of BGM, instrumental music, or background music without vocals | audio_peanut_generate |
Single API tool: call when parameters are complete; after a failure, retry once and then return an error; no cross-tool fallback.
Parameter definitions
| Parameter | Type | Required | Range | Default | Description |
|---|---|---|---|---|---|
prompt |
STRING | Yes | -- | -- | Instrumental music description (theme/style/scenario/emotion). If missing → prompt "Please describe the music style or scenario you want" |
duration |
NUMBER | Yes | 30–120 | 30 | Generation duration (seconds). If out of range, automatically clamp to 30–120 and inform the user |
prompt Organized by the Agent into a structured style/scenario/emotion description.
Tool invocation
meitu audio-music-generate --prompt "<style/scene/mood>" [--duration 30] --json --download-dir {output_dir} --skill_name skill_audio-music-generate
Error degradation
| Scenario | Handling method |
|---|---|
prompt Missing |
Prompt "Please describe the music style or scenario you want", do not call the API |
duration Out of 30–120 |
Automatically clamp, inform the user |
| User requests >120s | Inform that the maximum is 120s, clamp |
audio_peanut_generate Call failed |
Retry once; if it still fails, return an error |
| Style description is vague | Prompt to supplement style/scenario/emotion preferences |
| Content compliance interception | Directly return a compliance prompt, do not retry |
Deliver
- Use the output_dir parsed by Preflight
- From
downloaded_files[0].saved_pathread the downloaded audio file path mv {downloaded_files[0].saved_path} {output_dir}/{YYYY-MM-DD}_{descriptive}_audio-music-generate.mp3
Output
- Format:MP3
- Location: project →
./output/, one-time →$VISUAL/output/audio-music-generate/
Baseline Task ID
See references/task-id-baseline.md for the corresponding row.