audio-cog

GitHub

作为OpenSquilla兼容适配器,通过OpenRouter API生成专业音频(旁白、音乐等)。接收JSON脚本输入,输出WAV文件及AUDIO_READY状态,支持配置缺失或模型不支持时的优雅降级处理。

src/opensquilla/skills/bundled/audio-cog/SKILL.md opensquilla/opensquilla

Trigger Scenarios

需要调用AI生成语音、音乐或音效的场景 网页元技能中集成音频资产生成的需求

Install

npx skills add opensquilla/opensquilla --skill audio-cog -g -y
More Options

Non-standard path

npx skills add https://github.com/opensquilla/opensquilla/tree/main/src/opensquilla/skills/bundled/audio-cog -g -y

Use without installing

npx skills use opensquilla/opensquilla@audio-cog

指定 Agent (Claude Code)

npx skills add opensquilla/opensquilla --skill audio-cog -a claude-code -g -y

安装 repo 全部 skill

npx skills add opensquilla/opensquilla --all -g -y

预览 repo 内 skill

npx skills add opensquilla/opensquilla --list

SKILL.md

Frontmatter
{
    "name": "audio-cog",
    "author": "CellCog",
    "homepage": "https:\/\/cellcog.ai",
    "metadata": {
        "openclaw": {
            "os": [
                "darwin",
                "linux",
                "windows"
            ],
            "emoji": "🎵",
            "requires": {
                "env": [
                    "CELLCOG_API_KEY"
                ],
                "bins": [
                    "python3"
                ]
            }
        },
        "opensquilla": {
            "risk": "medium",
            "requires": {
                "env": [],
                "bins": [
                    "python3"
                ],
                "config": [
                    "awesome_webpage.openrouter.models.audio_generation",
                    "awesome_webpage.output_dir"
                ]
            },
            "capabilities": [
                "network-write",
                "filesystem-write"
            ]
        }
    },
    "entrypoint": {
        "env": {
            "OPENSQUILLA_META_CAPABILITY_LEASE_REQUIRED": "1"
        },
        "args": [
            "--model",
            "{{ with.model | default('openai\/gpt-audio-mini') }}",
            "--output-dir",
            "{{ with.output_dir }}",
            "--filename",
            "{{ with.filename | default('narration.wav') }}",
            "--voice",
            "{{ with.voice | default('cedar') }}"
        ],
        "parse": "text",
        "stdin": "{{ with.payload | default(with.prompt | default(inputs.user_message)) }}",
        "command": "python {baseDir}\/scripts\/openrouter_audio.py",
        "timeout": 240
    },
    "provenance": {
        "origin": "clawhub-mit0",
        "license": "MIT-0",
        "upstream_url": "https:\/\/clawhub.ai\/skills\/audio-cog",
        "maintained_by": "OpenSquilla"
    },
    "description": "OpenSquilla-compatible audio generation adapter for webpage audio requests. Prefer OpenRouter config\/API key in OpenSquilla; preserve the upstream CellCog workflow only as optional ClawHub provenance.",
    "dependencies": [
        "cellcog"
    ],
    "description_zh": "与OpenSquilla兼容的音频生成适配器,用于网页音频请求。优先使用OpenSquilla中的OpenRouter配置\/API密钥;仅将上游CellCog工作流作为可选的ClawHub来源保留。"
}

Audio Cog - AI Audio Generation Powered by CellCog

Create professional audio with AI — voiceovers, music, sound effects, and personalized avatar voices.

Meta-Skill Entrypoint

Meta-skills should run this skill as skill_exec when they need OpenRouter audio. The entrypoint is a deterministic Python adapter. During MetaSkill execution it receives a short-lived provider connection from ordinary Provider Settings in the child process only; the credential and endpoint never enter with, argv, the plan, or persisted run data. It calls the configured OpenRouter audio model, writes a browser-playable WAV file under the supplied output directory, and prints either AUDIO_READY: or a single failure label. Do not spawn an LLM sub-agent just to generate audio.

Prefer JSON payload mode when the caller already has a narration script:

{"script": "exact spoken narration text"}

In payload mode the adapter asks the audio model to speak exactly that transcript and not add acknowledgements, titles, or setup text.

OpenSquilla Compatibility Contract

When invoked from OpenSquilla, this skill is an adapter around the caller's configured provider. Do not require CELLCOG_API_KEY, do not assume the cellcog package is installed, and do not invent provider credentials.

For AwesomeWebpageMetaSkill:

  • Use the code-owned OpenRouter capability candidate and the volatile provider lease resolved from ordinary Provider Settings after explicit approval.
  • Use only config.awesome_webpage.openrouter.models.audio_generation for audio model selection.
  • Save generated or processed files only under config.awesome_webpage.output_dir/project/assets/audio.
  • If the OpenRouter key, audio model, or output directory is missing, return a concise AUDIO_CONFIG_NEEDED report listing the missing config keys.
  • If the configured OpenRouter model cannot return a browser-playable audio file, return AUDIO_MODEL_UNSUPPORTED with the narration/script, desired duration, style, and target filename so the webpage can expose a clean replacement slot instead of failing the whole project.

On success: AUDIO_READY manifest line (required)

After every successful save, end your reply with one single-line JSON record per file so AwesomeWebpageMetaSkill can collect and bind the assets:

AUDIO_READY: {"local_path": "project/assets/audio/<slug>.wav", "mime": "audio/wav", "duration_s": <int_or_null>, "voice": "<voice>", "script_preview": "<first 80 chars>"}
  • One AUDIO_READY: line per audio file. No trailing prose on that line.
  • local_path MUST be the relative path project/assets/audio/.... Do NOT emit an absolute path here.
  • On failure, emit one of AUDIO_CONFIG_NEEDED, AUDIO_MODEL_UNSUPPORTED, or AUDIO_GENERATION_FAILED as a single-line label with the replacement-slot path so the page can render a placeholder.

OpenRouter Audio API Contract (hard rule for openai/gpt-audio*)

The default CellCog code-path is wrong for OpenSquilla and will fail. OpenRouter routes openai/gpt-audio / openai/gpt-audio-mini through OpenAI's audio-output mode, which has a strict request shape:

  • POST {base_url}/chat/completions with body:
    {
      "model": "<audio_generation>",
      "stream": true,
      "modalities": ["text", "audio"],
      "audio": {"voice": "alloy", "format": "pcm16"},
      "messages": [...]
    }
    
  • stream: true is REQUIRED. Non-streaming requests are rejected with HTTP 400 "Audio output requires stream: true".
  • audio.format MUST be pcm16 when streaming. mp3, opus, flac, wav are all rejected as "unsupported_value" — there is no alternative combo. Sending format=mp3 (any stream setting) burns ~190 s of per-attempt timeout for nothing; do not try it.
  • Read the SSE response, base64-decode each delta.audio.data chunk, concatenate the raw 24kHz mono signed-16-bit-little-endian PCM stream, then save it as a browser-playable WAV file.
  • Final on-disk asset is .wav. Set MIME to audio/wav in the manifest.
  • If the required MetaSkill provider lease is missing or invalid, emit AUDIO_CONFIG_NEEDED and exit 78 before any provider submission. Direct standalone CLI use may still read OPENROUTER_API_KEY; never fall back to CELLCOG_API_KEY or another provider.
  • Provider/model failures after submission remain an exit-0 degradation with a structured replacement slot. They are never automatically replayed.

Upstream CellCog instructions are intentionally omitted from the executable prompt body. OpenSquilla meta-skills use the entrypoint above; provenance is kept in frontmatter for registry/audit purposes.

Version History

  • 95673be Current 2026-08-07 00:57

    重构凭证注入机制,从显式环境变量注入改为使用volatile provider lease;更新配置读取路径以适配AwesomeWebpageMetaSkill的新结构。

  • f662be3 2026-07-31 11:47

    版本变更中文摘要(若无变更则为空字符串)

  • 7f72a32 2026-07-05 18:38

Dependencies

Same Skill Collection

src/opensquilla/skills/bundled/advanced-dubbing-studio/SKILL.md
src/opensquilla/skills/bundled/ai-video-script/SKILL.md
src/opensquilla/skills/bundled/awesome-webpage-image-download/SKILL.md
src/opensquilla/skills/bundled/awesome-webpage-research/SKILL.md
src/opensquilla/skills/bundled/AwesomeWebpageMetaSkill/SKILL.md
src/opensquilla/skills/bundled/cron/SKILL.md
src/opensquilla/skills/bundled/docx/SKILL.md
src/opensquilla/skills/bundled/filesystem/SKILL.md
src/opensquilla/skills/bundled/git-diff/SKILL.md
src/opensquilla/skills/bundled/github/SKILL.md
src/opensquilla/skills/bundled/history-explorer/SKILL.md
src/opensquilla/skills/bundled/html-coder/SKILL.md
src/opensquilla/skills/bundled/html-to-pdf/SKILL.md
src/opensquilla/skills/bundled/http-fetch/SKILL.md
src/opensquilla/skills/bundled/latex-compile/SKILL.md
src/opensquilla/skills/bundled/memory/SKILL.md
src/opensquilla/skills/bundled/meta-kid-project-planner/SKILL.md
src/opensquilla/skills/bundled/multi-search-engine/SKILL.md
src/opensquilla/skills/bundled/music-and-singing-studio/SKILL.md
src/opensquilla/skills/bundled/nano-banana-pro-openrouter/SKILL.md
src/opensquilla/skills/bundled/nano-banana-pro/SKILL.md
src/opensquilla/skills/bundled/nano-pdf/SKILL.md
src/opensquilla/skills/bundled/openrouter-video-generator/SKILL.md
src/opensquilla/skills/bundled/paper-abstract-author/SKILL.md
src/opensquilla/skills/bundled/paper-artifact-runtime/SKILL.md
src/opensquilla/skills/bundled/paper-citation-integrity-gate/SKILL.md
src/opensquilla/skills/bundled/paper-citation-planner/SKILL.md
src/opensquilla/skills/bundled/paper-delivery-summary/SKILL.md
src/opensquilla/skills/bundled/paper-experiment-stub/SKILL.md
src/opensquilla/skills/bundled/paper-latex-sanitizer/SKILL.md
src/opensquilla/skills/bundled/paper-length-gate/SKILL.md
src/opensquilla/skills/bundled/paper-outline-author/SKILL.md
src/opensquilla/skills/bundled/paper-preference-planner/SKILL.md
src/opensquilla/skills/bundled/paper-quality-gate/SKILL.md
src/opensquilla/skills/bundled/paper-refbib-stub/SKILL.md
src/opensquilla/skills/bundled/paper-revision-author/SKILL.md
src/opensquilla/skills/bundled/paper-section-author/SKILL.md
src/opensquilla/skills/bundled/paper-source-curator/SKILL.md
src/opensquilla/skills/bundled/paper-source-readiness-gate/SKILL.md
src/opensquilla/skills/bundled/pptx/SKILL.md
src/opensquilla/skills/bundled/seedance-2-prompt/SKILL.md
src/opensquilla/skills/bundled/short-drama-delivery-audit/SKILL.md
src/opensquilla/skills/bundled/short-drama-review-normalizer/SKILL.md
src/opensquilla/skills/bundled/skill-creator-linter/SKILL.md
src/opensquilla/skills/bundled/skill-creator-proposals/SKILL.md
src/opensquilla/skills/bundled/skill-creator-smoke-test/SKILL.md
src/opensquilla/skills/bundled/srt-from-script/SKILL.md
src/opensquilla/skills/bundled/stack-trace-generic-probe/SKILL.md
src/opensquilla/skills/bundled/stack-trace-go-probe/SKILL.md

Metadata

Files
0
Version
95673be
Hash
9bd944d3
Indexed
2026-07-05 18:38

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-09 00:57
浙ICP备14020137号-1 $Carte des visiteurs$