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. - INLINECODE5 is used only for optional local audio assembly and mixing.
Official TTS Constraints
Use the official SenseAudio TTS rules summarized below:
- - HTTP endpoint: INLINECODE6
- Model: INLINECODE7
- Max text length per request:
10000 characters - INLINECODE9 is required
- INLINECODE10 range: INLINECODE11
- INLINECODE12 range:
-12 to INLINECODE14 - Optional audio formats:
mp3, wav, pcm, INLINECODE18 - Optional sample rates:
8000, 16000, 22050, 24000, 32000, INLINECODE24 - Optional MP3 bitrates:
32000, 64000, 128000, INLINECODE28 - Optional channels:
1 or INLINECODE30 - INLINECODE31 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
CODEBLOCK0
Local Assembly Pattern
CODEBLOCK1
Style Presets
- - Documentary: slower
speed such as 0.95, neutral INLINECODE43 - Tutorial:
speed near 1.0, slightly warmer INLINECODE46 - Commercial: modestly faster
speed, slightly higher INLINECODE48
Prefer conservative tuning and script editing over extreme voice parameter changes.
Output Options
- - Per-segment narration clips in
mp3 or INLINECODE50 - Timing metadata in INLINECODE51
- 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.
SenseAudio 视频旁白
为视频创建专业的旁白音频,支持时间感知分段、自然表达和编辑器友好导出。
此技能的功能
- - 生成与脚本时间戳同步的旁白音频
- 根据视频类型(如纪录片或教程)匹配旁白风格
- 使用官方TTS参数和文本中断标记控制语速
- 使用不同声音或风格创建多个旁白版本
- 导出音频片段和合并后的旁白轨道,便于编辑工作流
凭证和依赖规则
- - 从 SENSEAUDIOAPIKEY 读取API密钥。
- 仅通过 Authorization: Bearer 发送认证信息。
- 不要将API密钥放在查询参数、日志或保存的示例中。
- 如果使用Python辅助工具,此技能需要 python3、requests 和 pydub。
- pydub 仅用于可选的本地音频组装和混音。
官方TTS约束
使用以下总结的官方SenseAudio TTS规则:
- - HTTP端点:POST https://api.senseaudio.cn/v1/t2av2
- 模型:SenseAudio-TTS-1.0
- 每次请求最大文本长度:10000 字符
- voicesetting.voiceid 为必填项
- voicesetting.speed 范围:0.5-2.0
- voicesetting.pitch 范围:-12 到 12
- 可选音频格式:mp3、wav、pcm、flac
- 可选采样率:8000、16000、22050、24000、32000、44100
- 可选MP3比特率:32000、64000、128000、256000
- 可选声道数:1 或 2
- extrainfo.audio_length 返回以毫秒为单位的片段时长
- 文本中支持内联中断标记,如
推荐工作流
- 1. 准备脚本:
- 将旁白分割成带时间戳的片段。
- 确保每个片段长度远低于 10000 字符限制。
- 2. 选择声音和语速配置:
- 选择一个 voice_id,并调整 speed、pitch 和可选的 vol。
- 当时间精度要求高时,使用较短的片段。
- 3. 生成音频片段:
- 为每个片段调用TTS API。
- 保存前将 data.audio 从十六进制解码。
- 捕获 extra
info.audiolength 作为时间轴元数据。
- 4. 本地组装旁白轨道:
- 使用 pydub 将片段放置在静音主轨道上。
- 保留每个片段的文件,便于编辑器导入和重新调整时间。
- 5. 根据视频验证时间:
- 当需要自然语速时,留出小间隙。
- 调整片段边界,而不是过度使用极端速度值。
最小时间旁白辅助工具
python
import binascii
import os
import re
import requests
APIKEY = os.environ[SENSEAUDIOAPI_KEY]
APIURL = https://api.senseaudio.cn/v1/t2av2
def parsetimedscript(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 synthesizesegment(text, voiceid, speed=1.0, pitch=0, vol=1.0):
response = requests.post(
API_URL,
headers={
Authorization: fBearer {API_KEY},
Content-Type: application/json,
},
json={
model: SenseAudio-TTS-1.0,
text: text,
stream: False,
voice_setting: {
voiceid: voiceid,
speed: speed,
pitch: pitch,
vol: vol,
},
audio_setting: {
format: mp3,
sample_rate: 32000,
bitrate: 128000,
channel: 2,
},
},
timeout=60,
)
response.raiseforstatus()
data = response.json()
return {
audio_bytes: binascii.unhexlify(data[data][audio]),
durationms: data[extrainfo][audio_length],
traceid: data.get(traceid),
}
本地组装模式
python
from pydub import AudioSegment
def createsyncednarration(audiosegments, videoduration_ms):
narrationtrack = AudioSegment.silent(duration=videoduration_ms)
for segment in audio_segments:
clip = AudioSegment.from_file(segment[file])
narrationtrack = narrationtrack.overlay(clip, position=segment[timestamp])
return narration_track
风格预设
- - 纪录片:较慢的 speed(如 0.95),中性 pitch
- 教程:speed 接近 1.0,略微温暖的 pitch
- 商业广告:适度加快的 speed,略高的 pitch
优先使用保守调整和脚本编辑,而非极端的声音参数变化。
输出选项
- - 每个片段的旁白剪辑,格式为 mp3 或 wav
- 时间元数据,格式为 json
- 为视频编辑器提供的合并旁白轨道
- 可选的不同风格备用版本
安全注意事项
- - 不要硬编码凭证。
- 不要假设存在除此处声明的本地媒体工具。
- 将返回的 trace_id 和生成的旁白资产视为潜在敏感的生产数据。