返回顶部
f

feishu-asr

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

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
83
下载量
0
收藏
概述
安装方式
版本历史

feishu-asr

# 飞书语音识别 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') feature_extractor = WhisperFeatureExtractor.from_pretrained('openai/whisper-tiny') # 识别 input_features = feature_extractor(audio, sampling_rate=16000, return_tensors='pt').input_features with torch.no_grad(): predicted_ids = model.generate(input_features) result = processor.batch_decode(predicted_ids, skip_special_tokens=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

下载 Zip 包

⬇ 下载 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 镜像加速首次模型下载

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部