当前位置: 首页 > Skill >

Simple sound-to-text skill locally

Simple sound-to-text skill locally

Simple sound-to-text skill locally

使用 OpenAI Whisper 的本地语音转文字功能。适用于:(1) 将音频文件转录为文本;(2) 将语音消息转换为文字内容;(3) 快速准确地将语音内容转换为可编辑的文本。

1.0.2 2026.11.15 723
获取Skill文件查看使用说明
作 者:顾禾 许可证: 更新时间:2026.11.15
本文目录展开

STT Simple - Local Speech-to-Text

🎯 触发场景 / Trigger Scenarios

使用此技能当用户需要 / Use this skill when user needs to:

  1. 转录音频文件 / Transcribe audio files - 将 .ogg, .wav, .mp3 等格式转为文字 / Convert .ogg, .wav, .mp3 to text
  2. 处理语音消息 / Process voice messages - WhatsApp/Telegram 语音消息转文字 / Voice message to text
  3. 多语言识别 / Multi-language recognition - 支持中文、英文、日文等 99+ 语言 / Supports Chinese, English, Japanese, etc. (99+ languages)
  4. 批量转录 / Batch transcription - 处理多个音频文件 / Process multiple audio files
  5. 多 Agent 协作 / Multi-Agent collaboration - 多个 Agent 同时转录,输出隔离 / Multiple Agents transcribe simultaneously with isolated outputs

🚀 执行流程 / Execution Flow

1️⃣ 检查安装状态 / Check Installation

/root/.openclaw/venv/stt-simple/bin/whisper --version

如果未安装,先运行安装脚本 / If not installed, run install script first:

/root/.openclaw/workspace/skills/stt-simple/scripts/install.sh

2️⃣ 选择模型 / Model Selection

模型 / Model 大小 / Size 速度 / Speed 精度 / Accuracy 推荐场景 / Recommended For
tiny 39MB ⚡⚡⚡ ⭐⭐⭐ 快速测试 / Quick testing
base 74MB ⚡⚡ ⭐⭐⭐⭐ 日常使用 / Daily use
small 244MB ⚡ ⭐⭐⭐⭐⭐ 默认推荐 / Default
medium 769MB 🐌 ⭐⭐⭐⭐⭐ 高精度需求 / High accuracy
large 1.5GB 🐌🐌 ⭐⭐⭐⭐⭐+ 最佳质量 / Best quality

3️⃣ 执行转录 / Execute Transcription

方法 A: 使用 Whisper 命令行 / Use Whisper CLI

/root/.openclaw/venv/stt-simple/bin/whisper <audio_file> --model small --language Chinese

方法 B: 使用 Python 脚本(推荐支持多 Agent) / Use Python Script (Recommended for Multi-Agent)

# Without session isolation / 无会话隔离
/root/.openclaw/venv/stt-simple/bin/python 
  /root/.openclaw/workspace/skills/stt-simple/scripts/stt_simple.py 
  <audio_file> small zh

# With session isolation / 带会话隔离(多 Agent 场景)
/root/.openclaw/venv/stt-simple/bin/python 
  /root/.openclaw/workspace/skills/stt-simple/scripts/stt_simple.py 
  <audio_file> small zh agent-main-whatsapp

4️⃣ 输出位置 / Output Location

  • 文本输出 / Text output: /root/.openclaw/workspace/stt_output/<session_id>/<filename>_<timestamp>.txt
  • JSON 输出 / JSON output: 包含时间戳和置信度(如需)/ Includes timestamps and confidence (if needed)

🌍 语言代码 / Language Codes

语言 / Language 代码 / Code 别名 / Alias
中文 / Chinese zh Chinese
英文 / English en English
日文 / Japanese ja Japanese
韩文 / Korean ko Korean
法文 / French fr French
德文 / German de German
西班牙文 / Spanish es Spanish

自动检测 / Auto-detect: 省略 --language 参数 / Omit --language parameter

📁 输出格式 / Output Formats

  • .txt - 纯文本 / Plain text (default)
  • .json - 完整结果(含时间戳、置信度)/ Full results (with timestamps, confidence)
  • .srt - 字幕格式(视频用)/ Subtitle format (for videos)
  • .vtt - WebVTT(网页用)/ WebVTT (for web)

🔧 故障排查 / Troubleshooting

检查安装 / Check Installation

/root/.openclaw/venv/stt-simple/bin/whisper --version

重新安装 / Reinstall

rm -rf /root/.openclaw/venv/stt-simple
/root/.openclaw/workspace/skills/stt-simple/scripts/install.sh

手动下载模型 / Manual Model Download

/root/.openclaw/venv/stt-simple/bin/python 
  -c "import whisper; whisper.load_model('small')"

📦 资源文件 / Resources

文件 / File 路径 / Path 用途 / Purpose
安装脚本 / Install script scripts/install.sh 一键安装虚拟环境、依赖、模型 / One-click install venv, dependencies, models
Python 脚本 / Python script scripts/stt_simple.py 简化的转录 API,返回 JSON 结果 / Simplified transcription API with JSON output

💡 使用示例 / Examples

示例 1: 转录中文语音消息 / Transcribe Chinese voice message

/root/.openclaw/venv/stt-simple/bin/whisper 
  /root/.openclaw/media/inbound/voice.ogg 
  --model small --language Chinese

示例 2: 转录英文会议录音 / Transcribe English meeting recording

/root/.openclaw/venv/stt-simple/bin/whisper 
  meeting.wav --model medium --language en

示例 3: 使用 Python API 获取 JSON 结果 / Use Python API for JSON output

/root/.openclaw/venv/stt-simple/bin/python 
  /root/.openclaw/workspace/skills/stt-simple/scripts/stt_simple.py 
  audio.ogg small zh

示例 4: 多 Agent 场景 - 带会话隔离 / Multi-Agent with Session Isolation

# Jari (WhatsApp) - outputs to /root/.openclaw/workspace/stt_output/agent-jari-whatsapp/
/root/.openclaw/venv/stt-simple/bin/python 
  /root/.openclaw/workspace/skills/stt-simple/scripts/stt_simple.py 
  voice_a.ogg small zh agent-jari-whatsapp

# Other Agent (Telegram) - outputs to /root/.openclaw/workspace/stt_output/agent-telegram/
/root/.openclaw/venv/stt-simple/bin/python 
  /root/.openclaw/workspace/skills/stt-simple/scripts/stt_simple.py 
  voice_b.ogg small zh agent-telegram

🔐 多 Agent 支持 / Multi-Agent Support

为什么需要会话隔离 / Why Session Isolation?

当多个 Agent 同时使用 STT 功能时:

  • 避免输出文件冲突 / Avoid output file conflicts
  • 每个 Agent 可以追踪自己的转录结果 / Each Agent can track its own transcriptions
  • 便于清理和管理 / Easier cleanup and management

会话 ID 命名建议 / Session ID Naming Suggestions

Agent / 场景 推荐 session_id 输出目录 / Output Directory
Jari (WhatsApp) agent-jari-whatsapp stt_output/agent-jari-whatsapp/
Eric (WhatsApp) agent-eric-whatsapp stt_output/agent-eric-whatsapp/
Telegram Agent agent-telegram stt_output/agent-telegram/
临时会话 session-<uuid> stt_output/session-<uuid>/
用户专属 user-<user_id> stt_output/user-<user_id>/

输出文件命名规则 / Output File Naming

<audio_filename>_<unique_timestamp>.txt

例如 / For example:

  • voice_a_3f8b2c1d.txt
  • meeting_9a4e7f2b.txt

每个文件名包含唯一的时间戳后缀,即使同一音频多次转录也不会覆盖。 Each filename includes a unique timestamp suffix, preventing overwrites even for repeated transcriptions.

⚠️ 注意事项 / Notes

  1. CPU vs GPU: 默认使用 CPU,FP16 会自动降级为 FP32 / Defaults to CPU, FP16 auto-downgrades to FP32
  2. 首次运行 / First run: 首次使用会下载模型(small 约 244MB)/ Downloads model on first use (~244MB for small)
  3. 输出目录 / Output directory: 结果保存在 /root/.openclaw/workspace/stt_output/ / Results saved to /root/.openclaw/workspace/stt_output/
  4. 隐私安全 / Privacy: 所有处理在本地完成,音频文件不会上传 / All processing is local, audio files never uploaded
  5. 多 Agent / Multi-Agent: 建议使用 session_id 参数隔离输出 / Recommended to use session_id parameter for output isolation

🔑 默认配置 / Default Configuration

当前会话标识符 / Current Session ID:

agent-jari-whatsapp

输出目录 / Output Directory:

/root/.openclaw/workspace/stt_output/agent-jari-whatsapp/

快速调用 / Quick Start:

# 转录当前 WhatsApp 语音消息 / Transcribe current WhatsApp voice message
/root/.openclaw/venv/stt-simple/bin/python 
  /root/.openclaw/workspace/skills/stt-simple/scripts/stt_simple.py 
  <audio_file> small zh agent-jari-whatsapp

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,018
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,013
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,013
Skill 文件
  • SKILL.md
    • STT Simple - Local Speech-to-Text
    • 🎯 触发场景 / Trigger Scenarios
    • 🚀 执行流程 / Execution Flow
      • 1️⃣ 检查安装状态 / Check Installation
      • 2️⃣ 选择模型 / Model Selection
      • 3️⃣ 执行转录 / Execute Transcription
      • 4️⃣ 输出位置 / Output Location
    • 🌍 语言代码 / Language Codes
    • 📁 输出格式 / Output Formats
    • 🔧 故障排查 / Troubleshooting
      • 检查安装 / Check Installation
      • 重新安装 / Reinstall
      • 手动下载模型 / Manual Model Download
    • 📦 资源文件 / Resources
    • 💡 使用示例 / Examples
      • 示例 1: 转录中文语音消息 / Transcribe Chinese voice message
      • 示例 2: 转录英文会议录音 / Transcribe English meeting recording
      • 示例 3: 使用 Python API 获取 JSON 结果 / Use Python API for JSON output
      • 示例 4: 多 Agent 场景 - 带会话隔离 / Multi-Agent with Session Isolation
    • 🔐 多 Agent 支持 / Multi-Agent Support
      • 为什么需要会话隔离 / Why Session Isolation?
      • 会话 ID 命名建议 / Session ID Naming Suggestions
      • 输出文件命名规则 / Output File Naming
    • ⚠️ 注意事项 / Notes
    • 🔑 默认配置 / Default Configuration
  • 项目或源文件

相关 Skill

更多
Whisper Transcribe Whisper Transcribe 使用 OpenAI Whisper 将音频文件转录为文本。支持自动语言检测,提供 txt、srt、vtt、json 等多种输出格式,支持批量处理和模型选择(tiny 到 large)。适用于音频录音、播客、语音消息、讲座、会议及任意音视频转写。支持 mp3、wav、m4a、ogg、flac、webm、opus、aac 格式。
Whisper GPU Audio Transcriber Whisper GPU Audio Transcriber 利用OpenAI Whisper将音频转换为SRT字幕,支持Intel XPU、NVIDIA CUDA、AMD ROCm及Apple Metal的自动GPU加速,适用于内容创作者。
Whisper Wrap Whisper Wrap OpenAI Whisper?????? - ?????Python??
faster-whisper 高性能语音转录库 faster-whisper 高性能语音转录库 faster-whisper 是 SYSTRAN 基于 CTranslate2 对 OpenAI Whisper 的高性能重新实现。它专为需要更低延迟、更低内存使用率、可选量化以及适用于批量或实时语音工作流程的实际 Python 集成的转录管道而构建。
acestep-lyrics-transcription acestep-lyrics-transcription 使用 OpenAI Whisper 或 ElevenLabs Scribe API 将音频转录为带时间戳的歌词。输出 LRC、SRT 或 JSON 格式(含词级时间戳)。适用于转录歌曲、生成 LRC 文件或提取带时间戳歌词。