用途:通过 OpenAI 的 /v1/audio/transcriptions 接口(Whisper)把音频文件转写为文本。技能内提供脚本封装,底层为 curl 调用。
主要能力:转写音频文件为文本;可指定模型(默认 whisper-1);可指定输出文件路径(默认输出为输入文件同名的 .txt);可指定识别语言;可提供 prompt 以辅助识别(例如说话人姓名);可输出 JSON 格式结果。
使用方式:运行脚本并传入音频路径: {baseDir}/scripts/transcribe.sh /path/to/audio.m4a 常用参数示例: {baseDir}/scripts/transcribe.sh /path/to/audio.ogg --model whisper-1 --out /tmp/transcript.txt {baseDir}/scripts/transcribe.sh /path/to/audio.m4a --language en {baseDir}/scripts/transcribe.sh /path/to/audio.m4a --prompt "Speaker names: Peter, Daniel" {baseDir}/scripts/transcribe.sh /path/to/audio.m4a --json --out /tmp/transcript.json
API 密钥配置:可通过环境变量 OPENAI_API_KEY 设置,或在 ~/.openclaw/openclaw.json 中配置: { skills: { "openai-whisper-api": { apiKey: "OPENAI_KEY_HERE", }, }, }
适用场景:需要对音频文件做快速语音转文字,并希望以命令行方式集成到流程中。
限制:资料未提供支持的音频格式范围、文件大小上限、计费与价格、并发与速率限制、错误处理细节以及脚本内部实现说明。