微算力 · API 导航与自营网关
API 接入 EN
未登录登录
️

语音消息秒转文字,俄语识别更精准

Speech to Text (Yandex SpeechKit) · v1.1.5
效率 安全 B 级 作者 bzsega 公开目录收录
1.2k 下载 0 安装 5.2k 收藏 14 浏览

简介

基于 Yandex SpeechKit 的语音转文本技能,支持多格式音频识别,30 秒短语音即时转写,可扩展接入其他 STT 服务商。

原始描述

Speech recognition from voice messages using Yandex SpeechKit (with an extensible architecture for other providers). Use when you need to convert a voice mes...

通过你的 Agent 添加

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/speech-to-text-yandex-speechkit/
Codex CLI~/.codex/skills/speech-to-text-yandex-speechkit/
DeepSeek Harness~/.agents/skills/speech-to-text-yandex-speechkit/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心用法

Sergei Mikhailov STT 是 OpenClaw 生态的语音转文字技能,专门处理即时通讯场景中的语音消息转录。用户发送语音消息后,系统自动完成格式验证、音频转换(FFmpeg)、云端识别全流程,返回带置信度的文本结果。

工作流程:接收本地音频路径 → 验证格式与大小(≤1MB/约30秒)→ FFmpeg 预处理 → 调用 Yandex SpeechKit v1 同步 API → 返回结构化结果(文本/语言/置信度/耗时)。支持 OGG、WAV、MP3、M4A、FLAC、AAC 格式,默认俄英双语(ru-RU/en-US),架构预留多提供商扩展接口。

显著优点

  • 开箱即用:提供 setup.sh 一键配置虚拟环境与依赖,check.sh 诊断脚本覆盖 Python、FFmpeg、API 密钥全链路检测
  • 企业级识别引擎:背靠 Yandex SpeechKit,俄语识别准确率处于行业第一梯队
  • 灵活配置:支持 OpenClaw 全局配置、本地 .env、JSON 配置文件三级注入方式,便于多环境部署
  • 可扩展架构:基于 BaseSTTProvider 抽象类,新增提供商仅需实现 recognize/validate_config/get_supported_formats 三接口
  • 精细化错误映射:10 类典型错误(文件过大、401/403/429、FFmpeg 缺失等)全部转化为用户友好的自然语言提示与具体操作指引

潜在缺点与局限性

  • 硬性容量天花板:Yandex v1 同步 API 限制 1MB/约30秒,长语音需人工分段或等待 v3 异步接口支持
  • 生态依赖重:强制绑定 Python 3.8+、FFmpeg 系统二进制及 Yandex Cloud 服务账号(需 ai.speechkit.user IAM 角色),Windows 原生部署成本较高
  • 语言覆盖有限:默认仅俄英双语,小语种需自行接入第三方提供商
  • 延迟敏感:端到端处理依赖网络往返,弱网环境下 5 分钟超时阈值可能触发失败

适合人群

  • 俄语/英语为主要工作语言的 OpenClaw 用户(客服、社群运营、个人助理场景)
  • 已入驻 Yandex Cloud、具备服务账号管理经验的开发者或团队
  • 需要私有化部署语音处理、不愿接入国际云(Google/AWS)的合规敏感组织
  • 具备 Python 开发能力、计划定制化扩展其他 STT 引擎(如 Whisper、阿里云)的技术用户

常规风险

  • 密钥泄露风险:API 密钥以明文存储于本地 JSON/ENV 文件,多用户服务器需严格管控文件权限(建议 600)
  • 隐私合规边界:音频数据流经 Yandex Cloud 俄罗斯/欧盟节点,涉及敏感内容的语音需评估数据主权合规性
  • 速率限制突发:Yandex SpeechKit 免费档 QPS 限制较严,高并发场景可能触发 429 错误,需设计指数退避重试
  • FFmpeg 供应链风险:依赖系统级二进制,若通过非官方源安装可能引入编解码器漏洞,建议锁定版本并校验签名

技能正文


name: sergei-mikhailov-stt description: Speech recognition from voice messages using Yandex SpeechKit (with an extensible architecture for other providers). Use when you need to convert a voice message to text. metadata: {"openclaw": {"requires": {"bins": ["ffmpeg", "python3"], "env": ["YANDEX_API_KEY", "YANDEX_FOLDER_ID"]}, "primaryEnv": "YANDEX_API_KEY"}}

Speech to Text Skill for OpenClaw

Purpose

This skill recognizes speech from voice messages sent via any messenger connected to OpenClaw, using various STT providers, including Yandex SpeechKit.

When to Activate

Use this skill when:

  • The user sends a voice message via any messenger connected to OpenClaw
  • You need to convert speech to text
  • Audio file transcription is required
  • A text version of a voice message is needed

How It Works

1. Receive the audio file from OpenClaw

  • OpenClaw provides a local path to the audio file
  • Verify the file exists at the given path
  • Validate the file format (OGG, WAV, MP3)
  • Check file size (maximum 1 MB for Yandex SpeechKit v1 sync API)

Example path from OpenClaw:

/home/user_folder/.openclaw/media/inbound/file_1---9a53bac2-0392-41e7-8300-1c08e8eec027.ogg

2. Audio processing

  • Validate the audio file at the local path
  • Convert to a supported format if needed using ffmpeg
  • Verify audio quality

3. Speech recognition

  • Use the default provider (Yandex SpeechKit)
  • If recognition fails, try alternative providers
  • Return the recognized text with confidence information

4. Result handling

  • Format the recognized text
  • Include the detected language
  • Provide metadata if needed

Quick Start

clawhub install sergei-mikhailov-stt
cd ~/.openclaw/workspace/skills/sergei-mikhailov-stt
bash setup.sh

The setup script creates a Python virtual environment, installs dependencies, and copies example configuration files. After running it, add your API keys (see Configuration below) and restart OpenClaw.

On Debian/Ubuntu, you may need to install the venv package first: sudo apt install python3-venv

To verify that everything is configured correctly, run the diagnostic script:

bash check.sh

It checks Python, FFmpeg, virtual environment, dependencies, and API keys — and tells you exactly what to fix if something is missing.

Configuration

1. Set API keys (recommended — via OpenClaw config)

Add credentials to ~/.openclaw/openclaw.json:

{
  "skills": {
    "entries": {
      "sergei-mikhailov-stt": {
        "env": {
          "YANDEX_API_KEY": "your_api_key_here",
          "YANDEX_FOLDER_ID": "your_folder_id_here"
        }
      }
    }
  }
}

2. Alternative — via .env file

Edit the .env file created by setup.sh in the skill folder:

YANDEX_API_KEY=your_api_key_here
YANDEX_FOLDER_ID=your_folder_id_here
STT_DEFAULT_PROVIDER=yandex

3. Restart OpenClaw to apply changes

openclaw gateway stop && openclaw gateway start

4. Provider configuration (optional)

The config.json file (also created by setup.sh) lets you tune provider parameters:

{
  "default_provider": "yandex",
  "providers": {
    "yandex": {
      "api_key": "${YANDEX_API_KEY}",
      "folder_id": "${YANDEX_FOLDER_ID}",
      "lang": "ru-RU"
    }
  }
}

Adding a New STT Provider

1. Create the provider class

# scripts/providers/new_provider.py
from .base_provider import BaseSTTProvider

class NewProvider(BaseSTTProvider):
    name = "new_provider"

    def recognize(self, audio_file_path: str, language: str = 'ru-RU') -> str:
        # Recognition implementation
        pass

    def validate_config(self, config: dict) -> bool:
        # Configuration validation
        pass

    def get_supported_formats(self) -> list:
        return ['ogg', 'wav', 'mp3']

2. Register the provider

Add to scripts/stt_processor.py in the _get_provider method:

if provider_name == 'new_provider':
    return NewProvider(provider_config)

3. Update configuration

Add the new provider section to config.json:

{
  "providers": {
    "new_provider": {
      "api_key": "${NEW_PROVIDER_API_KEY}",
      "model": "latest"
    }
  }
}

Usage Examples

Basic scenario

User: [sends a voice message]
OpenClaw: Recognized text: "Hello, how are you?"

With language specified

User: Transcribe this English voice message
OpenClaw: Recognized text (en-US): "Hello, how are you today?"

With metadata

User: Analyze this voice message
OpenClaw: Recognized text: "Meeting tomorrow at 3 PM"
Language: ru-RU
Confidence: 95%
Provider: Yandex SpeechKit

Error Handling

When the skill returns an error, explain it to the user in plain language and suggest a concrete next step. Do not show raw error messages or stack traces.

Error Say to the user Next step
File too large "The voice message is too long — maximum is about 30 seconds for now." Ask them to send a shorter message
Unsupported format "This audio format is not supported." Tell them supported formats: OGG, WAV, MP3, M4A, FLAC, AAC
API key invalid / HTTP 401 "There's a problem with the Yandex SpeechKit API key." Ask owner to check YANDEX_API_KEY in openclaw.json
Folder access denied / HTTP 403 "Access to Yandex SpeechKit is denied." Ask owner to verify the service account has ai.speechkit.user role
Too many requests / HTTP 429 "Yandex SpeechKit is rate-limiting us right now." Try again in a few seconds
FFmpeg not found "Audio conversion tool (FFmpeg) is not installed on the server." Owner needs to run brew install ffmpeg or apt install ffmpeg
API request timed out "Yandex SpeechKit did not respond in time." Try again; if it repeats, the service may be down
Missing YANDEX_API_KEY "The skill is not configured yet — API keys are missing." Owner needs to add keys to ~/.openclaw/openclaw.json

Troubleshooting (for the owner)

  1. Verify API key configuration in ~/.openclaw/openclaw.json
  2. Ensure ffmpeg is installed: ffmpeg -version
  3. Check Yandex Cloud service account has role ai.speechkit.user
  4. Check gateway logs: openclaw logs

Limitations

  • Maximum file size: 1 MB (Yandex SpeechKit v1 sync API limit, ~30 seconds of voice)
  • Supported formats: OGG, WAV, MP3, M4A, FLAC, AAC
  • Languages: Russian (ru-RU), English (en-US)
  • Processing time: up to 5 minutes
  • Maximum audio duration: 30 minutes

Requirements

  • Python 3.8+
  • FFmpeg
  • Configured API keys for STT providers

Result Metadata

On successful recognition:

{
  "text": "Recognized text",
  "language": "ru-RU",
  "confidence": 0.95,
  "provider": "yandex",
  "processing_time": 2.5
}

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

speech-recognitionvoice-to-textyandex-speechkitaudio-processingsttmultilingualopenclawrussian-languageffmpeg

同类 Skill