baidu-speech-to-text

baidu-speech-to-text is a skill for Claude Code, Codex from castle-x/skills-x. It costs 49 tokens per session (1,146 once invoked), scanned A, original, MIT.

A speech-to-text tool that turns OGG or Opus voice messages into written text using Baidu's speech-recognition service. It supports Mandarin, English, Cantonese, and Sichuanese, including setups where a proxy is used for other services.

In plain words
What is it for?
Use it to transcribe voice messages received through WhatsApp or Discord, with an optional faster mode for Chinese audio.
Why use it?
It removes the need to listen to voice messages or manually transcribe them, while handling direct access to Baidu's API from a proxied domestic server.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: built for openclaw.

Good fit Use it to transcribe voice messages received through WhatsApp or Discord, with an optional faster mode for Chinese audio.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/castle-x/skills-x/baidu-speech-to-text
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add castle-x/skills-x --skill baidu-speech-to-text
Clone the repo
git clone --depth 1 https://github.com/castle-x/skills-x

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for baidu-speech-to-text

README.md
[![agentmods](https://agentmods.dev/badge/skills/castle-x/skills-x/baidu-speech-to-text/github.svg)](https://agentmods.dev/skills/castle-x/skills-x/baidu-speech-to-text)
Your own site
<a href="https://agentmods.dev/skills/castle-x/skills-x/baidu-speech-to-text"><img src="https://agentmods.dev/badge/skills/castle-x/skills-x/baidu-speech-to-text/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for baidu-speech-to-text

Your own site · 80×15
<a href="https://agentmods.dev/skills/castle-x/skills-x/baidu-speech-to-text"><img src="https://agentmods.dev/badge/skills/castle-x/skills-x/baidu-speech-to-text.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,146 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00049 $0.01146
Opus 5 $0.00024 $0.00573
Sonnet 5 $0.00010 $0.00229
Haiku 4.5 $0.00005 $0.00115

Measured 11d ago against content hash efe6e1d259f0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

baidu-speech-to-text scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/baidu_speech_to_text.py, scripts/ogg_to_text.sh, scripts/speech_to_text.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/baidu-speech-to-text/SKILL.md · 129 lines

How it starts

The opening of the file, as written. The whole thing — 129 lines — stays where its author put it; the contents beside it link to each section on GitHub.

百度语音识别 - 音频转文本

概述

本 skill 用于将用户发送的语音消息(ogg/opus 格式)转换为文本。使用百度语音识别 API,专为国内服务器 + 代理环境优化。

环境背景

问题场景

  • 国内服务器通过 proxychains4 代理访问海外服务(Discord、WhatsApp 等)
  • 百度 API 是国内服务,通过代理访问反而会失败(SSL 错误)
  • 需要在代理环境下选择性绕过百度 API

解决方案

  • 使用 wrapper 脚本,通过 unset LD_PRELOAD 绕过 proxychains 注入
  • 脚本内部清除代理环境变量,确保直连百度 API

脚本文件

脚本 路径 用途
ogg_to_text.sh /root/.openclaw/workspace/scripts/ogg_to_text.sh 推荐 - 简单易用
speech_to_text.sh /root/.openclaw/workspace/scripts/speech_to_text.sh 完整功能版
baidu_speech_to_text.py /root/.openclaw/workspace/scripts/baidu_speech_to_text.py Python 主脚本

使用方法

基本用法(中文普通话)

/root/.openclaw/workspace/scripts/ogg_to_text.sh <音频文件路径>

示例

# 转换用户语音消息
/root/.openclaw/workspace/scripts/ogg_to_text.sh /root/.openclaw/media/inbound/xxxxx.ogg

支持的语言

参数 语言
--lang zh 中文普通话(默认)
--lang en 英语
--lang cantonese 粤语
--lang sichuan 四川话

使用极速版(更快,仅中文)

/root/.openclaw/workspace/scripts/speech_to_text.sh <音频文件> --pro

音频文件位置

用户通过 WhatsApp/Discord 发送的语音消息保存在:

/root/.openclaw/media/inbound/

文件格式通常为 .ogg(Opus 编码),脚本会自动转换为 PCM 格式。

工作流程

当用户发送语音消息并请求转文本时:

  1. 确定语音文件路径(/root/.openclaw/media/inbound/*.ogg
  2. 执行转换:
    /root/.openclaw/workspace/scripts/ogg_to_text.sh /root/.openclaw/media/inbound/<文件名>.ogg
    
  3. 返回识别结果给用户

性能参考

阶段 耗时 说明
获取 token ~100ms 可缓存优化
ogg 转 pcm ~150-220ms ffmpeg 转换
API 调用 ~400-600ms 主要耗时
总计 ~700-1000ms

API 配置

使用环境变量提供百度 API 账号信息(请勿写入仓库):

export BAIDU_APP_ID="your_app_id"
export BAIDU_API_KEY="your_api_key"
export BAIDU_SECRET_KEY="your_secret_key"

端点:

错误处理

错误 原因 解决方案
SSL 错误 代理影响 确保使用 wrapper 脚本(.sh),不要直接调用 Python
识别结果为空 静音或无语音 告知用户音频可能没有语音内容
3301 错误 音频质量差 请用户重新录制
3303 错误 语音过长 需要分段处理

Read the full file on GitHub · 129 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 129 lines · 49 tokens per session scan A efe6e1d259f0

Subscribe to this mod's changes

baidu-speech-to-text is a skill published in the GitHub repository castle-x/skills-x (18 stars, last pushed 4mo ago), licensed MIT. It adds 49 tokens to every session and 1,146 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens