闲社服务运行正常AI智能体自动化平台
f

飞书语音识别

技能标识:feishu-asr

使用本地Whisper模型识别飞书语音消息。离线免费,不需要注册,不需要联网。

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 1.0.0
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

飞书语音识别

飞书语音识别 ASR

触发条件

  • - 用户发送飞书语音消息
  • 用户要求将语音转为文字
  • 用户提到语音识别、转文字

工作流程

1. 获取语音文件

从飞书消息中获取语音文件的file_key,下载为.ogg或.m4a格式。

2. 音频格式转换

使用Python soundfile将音频转换为16kHz采样的WAV格式:

python
import soundfile as sf
audio, sr = sf.read(voice_file)

如果是立体声,转为单声道


if len(audio.shape) > 1:
audio = audio.mean(axis=1)
sf.write(output.wav, audio, 16000)

3. 使用Whisper识别

python
import os
os.environ[HF_ENDPOINT] = https://hf-mirror.com # 国内镜像

from transformers import WhisperForConditionalGeneration, WhisperProcessor, WhisperFeatureExtractor
import soundfile as sf

读取音频

audio, sr = sf.read(output.wav) if len(audio.shape) > 1: audio = audio.mean(axis=1)

加载模型

processor = WhisperProcessor.from_pretrained(openai/whisper-tiny) model = WhisperForConditionalGeneration.from_pretrained(openai/whisper-tiny) featureextractor = WhisperFeatureExtractor.frompretrained(openai/whisper-tiny)

识别

inputfeatures = featureextractor(audio, samplingrate=16000, returntensors=pt).input_features with torch.no_grad(): predictedids = model.generate(inputfeatures)

result = processor.batchdecode(predictedids, skipspecialtokens=True)[0]

依赖安装

bash
pip install torch transformers soundfile

模型选择

  • - whisper-tiny: 75MB,适合CPU,最快
  • whisper-base: 142MB,精度更好
  • whisper-small: 466MB,精度高

注意事项

  • - 首次运行需要下载模型(约75MB-3GB)
  • 建议使用国内镜像:HF_ENDPOINT=https://hf-mirror.com
  • 模型会自动检测语言

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 feishu-asr-1776090558 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 feishu-asr-1776090558 技能

通过命令行安装

skillhub install feishu-asr-1776090558

下载

⬇ 下载 feishu-asr v1.0.0(免费)

文件大小: 3.88 KB | 发布时间: 2026-4-14 14:41

v1.0.0 最新 2026-4-14 14:41
feishu-asr 1.0.0 初始版本发布

- 支持通过本地 Whisper 模型识别飞书语音消息,离线免费,无需注册或联网
- 自动触发于收到飞书语音消息或用户要求转文字/语音识别
- 实现音频格式自动转换并支持多种常见音频格式(.ogg, .m4a)
- 提供 whisper-tiny、base、small 多种模型选择,兼顾精度与速度
- 支持通过国内 Hugging Face 镜像加速首次模型下载
返回顶部