walkie-talkie
Walkie-Talkie(WhatsApp 语音对话模式)
目标:用户既可以发文字也可以发语音;我都能理解并回复。若用户发语音,我会:
- 先转写成文字(用于理解与可读性)
- 再生成语音回复(语音消息 / voice note)
- 同时发回文字 + 语音(避免听不清/便于复制)
工作流
1) 收到语音消息(WhatsApp voice note / audio)
- 在消息上下文中找到音频附件的本地路径(通常会以
MEDIA: /path/to/file或类似字段出现)。 - 如音频为
ogg/opus,可直接用 Whisper;如遇到格式问题,先用 ffmpeg 转成 mp3:ffmpeg -y -i input.ogg -ar 16000 -ac 1 /tmp/in.mp3
- 用本地 Whisper CLI 转写:
whisper /tmp/in.mp3 --model small --output_format txt --output_dir /tmp- 读取
/tmp/in.txt得到转写文本。
- 将转写文本当作用户的真实输入来处理,并生成正常的文字回复。
2) 回复语音 + 文字
- 先发送文字回复(清晰、可复制)。
- 再把同样的内容用
tts工具生成音频,并用message工具作为语音消息发送:tts(text=回复内容)→ 得到MEDIA: ...message(action="send", channel="whatsapp", ... , filePath=<MEDIA路径>, asVoice=true)
触发方式
- 用户发送音频/语音消息时自动触发(若平台把转写/媒体路径注入上下文)。
- 或用户说:
- “开启语音模式 / walkie-talkie 模式”
- “用语音和我说”
约束/注意
- 转写默认用
--model small(速度/准确性折中);需要更准可提升到medium。 - 必须双回复:文字 + 语音。
- 任何一步缺依赖(找不到媒体路径、whisper 失败、tts 失败)要明确报错并给出下一步(例如让用户重发、或改用文字)。
手动命令(内部)
# 1) 语音转写
ffmpeg -y -i input.ogg -ar 16000 -ac 1 /tmp/in.mp3
whisper /tmp/in.mp3 --model small --output_format txt --output_dir /tmp
cat /tmp/in.txt
More from ypyt1/all-skills
commit-commands
Streamline your git workflow with simple commands for committing, pushing, and creating pull requests
11pr-review-toolkit
Comprehensive PR review agents specializing in comments, tests, error handling, type design, code quality, and code simplification
7atlas
macOS-only AppleScript control for the ChatGPT Atlas desktop app. Use only when the user explicitly asks to control Atlas tabs/bookmarks/history on macOS and the \"ChatGPT Atlas\" app is installed; do not trigger for general browser tasks or non-macOS environments.
4advanced-skill-creator
Advanced OpenClaw skill creation handler that executes the official 5-step research flow with comprehensive analysis and best practices. Ensures proper methodology when users request to create or modify OpenClaw/Moltbot/ClawDBot skills following official standards.
4desktop-app-dev
Desktop App Dev subagent
4homebrew
Homebrew package manager for macOS. Search, install, manage, and troubleshoot packages and casks.
3