diff --git a/phoneuse/android_mcp.py b/phoneuse/android_mcp.py index 4e91dae..366f166 100644 --- a/phoneuse/android_mcp.py +++ b/phoneuse/android_mcp.py @@ -928,7 +928,8 @@ def _build_server(): Full pipeline (runs on-device): text → edge-tts (MP3) → ffmpeg (16kHz PCM) → silk-wasm (SILK V3) - → SEND_VOICE_INTERNAL broadcast → WeChat DB insert (status=4, delivered) + → SEND_VOICE_CGI (internal uploadvoice cgi): audio uploaded + delivered to + recipient + sent bubble on the sender side. Verified end-to-end. **DO NOT implement SILK encoding yourself.** This tool handles the entire pipeline. Just pass the text you want spoken. diff --git a/phoneuse/wechat_hook_send.py b/phoneuse/wechat_hook_send.py index 21e2f0a..61250bf 100644 --- a/phoneuse/wechat_hook_send.py +++ b/phoneuse/wechat_hook_send.py @@ -472,7 +472,8 @@ def send_voice_tts_via_hook( """Generate TTS from *text* and send as WeChat voice message to *wxid*. End-to-end: edge-tts → ffmpeg (16kHz PCM) → silk-wasm (SILK V3) → - wechathook SEND_VOICE_INTERNAL broadcast → WeChat DB insert, status=4. + wechathook SEND_VOICE_CGI (internal uploadvoice cgi): uploads the audio + delivers + to the recipient AND inserts a sent bubble on the sender side. Verified end-to-end. Args: wxid: talker id (e.g. 'filehelper'). IMPORTANT: test only with 'filehelper'. @@ -498,10 +499,11 @@ def send_voice_tts_via_hook( except Exception as e: return {"status": "error", "error": f"TTS/SILK generation failed: {e}"} - # Delegate staging + broadcast to send_voice_via_hook (it handles both - # on-device and off-device paths). Must call while tmp dir is still alive. - result = send_voice_via_hook(wxid=wxid, silk_path=silk_path, - duration_ms=duration_ms) + # Delegate staging + broadcast to the fully-synthetic cgi sender (uploads audio + # inline via the internal uploadvoice cgi + delivers to the recipient + inserts a + # sent bubble). Must call while tmp dir is still alive. + result = send_voice_cgi_via_hook(wxid=wxid, silk_path=silk_path, + duration_ms=duration_ms) result["tts_text"] = text[:100] result["tts_voice"] = voice return result