From 3659eb7d994634c0c3e3cfc617d84bc0d22ccb58 Mon Sep 17 00:00:00 2001 From: liuwei Date: Thu, 29 May 2025 17:22:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8F=91=E8=AF=AD=E9=9F=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wechat_ipad/client/message.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wechat_ipad/client/message.py b/wechat_ipad/client/message.py index c1b3109..57296fc 100644 --- a/wechat_ipad/client/message.py +++ b/wechat_ipad/client/message.py @@ -338,13 +338,13 @@ class MessageMixin(WechatAPIClientBase): audio = AudioSegment.from_file(BytesIO(voice_byte), format="amr") voice_base64 = base64.b64encode(voice_byte).decode() elif format.lower() == "wave": - audio = AudioSegment.from_file(BytesIO(voice_byte), format="wav").set_channels(2) + audio = AudioSegment.from_file(BytesIO(voice_byte), format="wav").set_channels(1) audio = audio.set_frame_rate(self._get_closest_frame_rate(audio.frame_rate)) voice_base64 = base64.b64encode( await pysilk.async_encode(audio.raw_data, sample_rate=audio.frame_rate)).decode() voice_type = 4 elif format.lower() == "mp3": - audio = AudioSegment.from_file(BytesIO(voice_byte), format="mp3").set_channels(2) + audio = AudioSegment.from_file(BytesIO(voice_byte), format="mp3").set_channels(1) audio = audio.set_frame_rate(self._get_closest_frame_rate(audio.frame_rate)) voice_base64 = base64.b64encode( await pysilk.async_encode(audio.raw_data, sample_rate=audio.frame_rate)).decode()