360 Secure SkillHub
360 安全技能中心

Voice

在 Telegram 上自动将收到的语音消息(.ogg)用 faster-whisper 转写为文本,并通过 tts 工具以语音或文本回复;转写在本地 CPU 上运行,语言可自动检测或指定,TTS 需由宿主预先配置。

polityang
polityang
热度 89.75
最近更新 2026-05-11 17:31:09
分类:自动化依赖:代码执行应用场景:自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add telegram-voice
Metadata
name
voice
description
Voice communication via Telegram. Automatically transcribes incoming voice messages using faster-whisper and replies with TTS voice. Use for all voice-related interactions on Telegram.

Voice Communication

This skill enables voice communication on Telegram:

  1. Receive: Transcribe voice messages using faster-whisper
  2. Reply: Send voice replies using TTS

Incoming Voice (Automatic)

When receiving voice messages (.ogg files), use faster-whisper to transcribe:

from faster_whisper import WhisperModel

model = WhisperModel('base', device='cpu', compute_type='int8')
segments, info = model.transcribe('<file_path>', language='zh')
result = ''.join([s.text for s in segments])

Outgoing Voice (TTS)

Use the tts tool to send voice replies:

{
  "action": "send",
  "channel": "telegram", 
  "message": "<text>",
  "asVoice": true
}

Or use the tts tool directly:

{
  "channel": "telegram",
  "text": "<text to speak>"
}

Language

  • Input: Auto-detect or specify language (zh for Chinese)
  • Output: Match user's language preference

Requirements

  • faster-whisper: pip install faster-whisper
  • TTS already configured in OpenClaw