返回顶部
s

senseaudio-video-narrator

Generate SenseAudio TTS narration tracks for videos, including timestamped segments, style variants, and editor-ready voiceover exports. Use when users need voiceovers, video narration, timed commentary, or accessibility narration.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.1
安全检测
已通过
296
下载量
1
收藏
概述
安装方式
版本历史

senseaudio-video-narrator

# SenseAudio Video Narrator Create professional narration audio for videos with timing-aware segmentation, natural delivery, and editor-friendly exports. ## What This Skill Does - Generate narration audio synchronized to script timestamps - Match narration style to video genre such as documentary or tutorial - Control pacing with official TTS parameters and text break markers - Create multiple narration takes with different voices or styles - Export audio segments and merged narration tracks for editing workflows ## Credential and Dependency Rules - Read the API key from `SENSEAUDIO_API_KEY`. - Send auth only as `Authorization: Bearer <API_KEY>`. - Do not place API keys in query parameters, logs, or saved examples. - If Python helpers are used, this skill expects `python3`, `requests`, and `pydub`. - `pydub` is used only for optional local audio assembly and mixing. ## Official TTS Constraints Use the official SenseAudio TTS rules summarized below: - HTTP endpoint: `POST https://api.senseaudio.cn/v1/t2a_v2` - Model: `SenseAudio-TTS-1.0` - Max text length per request: `10000` characters - `voice_setting.voice_id` is required - `voice_setting.speed` range: `0.5-2.0` - `voice_setting.pitch` range: `-12` to `12` - Optional audio formats: `mp3`, `wav`, `pcm`, `flac` - Optional sample rates: `8000`, `16000`, `22050`, `24000`, `32000`, `44100` - Optional MP3 bitrates: `32000`, `64000`, `128000`, `256000` - Optional channels: `1` or `2` - `extra_info.audio_length` returns segment duration in milliseconds - Inline break markup such as `<break time=500>` is supported in text ## Recommended Workflow 1. Prepare the script: - Split narration into timestamped segments. - Keep each segment comfortably below the `10000` character limit. 2. Choose a voice and pacing profile: - Pick a `voice_id` and tune `speed`, `pitch`, and optional `vol`. - Use shorter segments when timing precision matters. 3. Generate audio segments: - Call the TTS API for each segment. - Decode `data.audio` from hex before saving. - Capture `extra_info.audio_length` for timeline metadata. 4. Assemble the narration track locally: - Use `pydub` to position clips on a silent master track. - Keep per-segment files for easier editor import and retiming. 5. Validate timing against the video: - Leave small gaps when natural pacing is needed. - Adjust segment boundaries instead of overusing extreme speed values. ## Minimal Timed Narration Helper ```python import binascii import os import re import requests API_KEY = os.environ["SENSEAUDIO_API_KEY"] API_URL = "https://api.senseaudio.cn/v1/t2a_v2" def parse_timed_script(script): pattern = r"\[(\d{2}):(\d{2}):(\d{2})\]\s*(.+?)(?=\n\[|\Z)" segments = [] for match in re.finditer(pattern, script, re.DOTALL): hours, minutes, seconds, text = match.groups() timestamp_ms = (int(hours) * 3600 + int(minutes) * 60 + int(seconds)) * 1000 segments.append({"timestamp": timestamp_ms, "text": text.strip()}) return segments def synthesize_segment(text, voice_id, speed=1.0, pitch=0, vol=1.0): response = requests.post( API_URL, headers={ "Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json", }, json={ "model": "SenseAudio-TTS-1.0", "text": text, "stream": False, "voice_setting": { "voice_id": voice_id, "speed": speed, "pitch": pitch, "vol": vol, }, "audio_setting": { "format": "mp3", "sample_rate": 32000, "bitrate": 128000, "channel": 2, }, }, timeout=60, ) response.raise_for_status() data = response.json() return { "audio_bytes": binascii.unhexlify(data["data"]["audio"]), "duration_ms": data["extra_info"]["audio_length"], "trace_id": data.get("trace_id"), } ``` ## Local Assembly Pattern ```python from pydub import AudioSegment def create_synced_narration(audio_segments, video_duration_ms): narration_track = AudioSegment.silent(duration=video_duration_ms) for segment in audio_segments: clip = AudioSegment.from_file(segment["file"]) narration_track = narration_track.overlay(clip, position=segment["timestamp"]) return narration_track ``` ## Style Presets - Documentary: slower `speed` such as `0.95`, neutral `pitch` - Tutorial: `speed` near `1.0`, slightly warmer `pitch` - Commercial: modestly faster `speed`, slightly higher `pitch` Prefer conservative tuning and script editing over extreme voice parameter changes. ## Output Options - Per-segment narration clips in `mp3` or `wav` - Timing metadata in `json` - Merged narration track for video editors - Optional alternate takes with different styles ## Safety Notes - Do not hardcode credentials. - Do not assume local media tooling exists beyond what is declared here. - Treat returned `trace_id` and generated narration assets as potentially sensitive production data.

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 video-narrator-1776107583 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 video-narrator-1776107583 技能

通过命令行安装

skillhub install video-narrator-1776107583

下载 Zip 包

⬇ 下载 senseaudio-video-narrator v1.0.1

文件大小: 3.12 KB | 发布时间: 2026-4-15 14:50

v1.0.1 最新 2026-4-15 14:50
- Updated metadata to clarify required environment variables, binaries (python3, ffmpeg), and Python library dependencies.
- Description and workflow now emphasize timestamped segmentation, editor-friendly exports, and multiple style/voice variants.
- Strict notes on credential handling: API key must use the SENSEAUDIO_API_KEY environment variable; never place credentials in query strings or logs.
- Expanded and clarified TTS API parameters, audio formats, and model constraints according to official SenseAudio documentation.
- Improved example code for segment synthesis and local track assembly, with commentary on recommended workflows and timing strategies.
- Output and safety instructions refined for clarity and security in production use.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部