mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-21 06:07:13 +08:00
fix: add voice dependency compatibility #641
This commit is contained in:
@@ -20,7 +20,6 @@ from common.tmp_dir import TmpDir
|
|||||||
from config import conf
|
from config import conf
|
||||||
from common.time_check import time_checker
|
from common.time_check import time_checker
|
||||||
from plugins import *
|
from plugins import *
|
||||||
from voice.audio_convert import mp3_to_wav
|
|
||||||
|
|
||||||
|
|
||||||
thread_pool = ThreadPoolExecutor(max_workers=8)
|
thread_pool = ThreadPoolExecutor(max_workers=8)
|
||||||
@@ -272,6 +271,7 @@ class WechatChannel(Channel):
|
|||||||
msg.download(mp3_path)
|
msg.download(mp3_path)
|
||||||
# mp3转wav
|
# mp3转wav
|
||||||
wav_path = os.path.splitext(mp3_path)[0] + '.wav'
|
wav_path = os.path.splitext(mp3_path)[0] + '.wav'
|
||||||
|
from voice.audio_convert import mp3_to_wav
|
||||||
mp3_to_wav(mp3_path=mp3_path, wav_path=wav_path)
|
mp3_to_wav(mp3_path=mp3_path, wav_path=wav_path)
|
||||||
# 语音识别
|
# 语音识别
|
||||||
reply = super().build_voice_to_text(wav_path)
|
reply = super().build_voice_to_text(wav_path)
|
||||||
|
|||||||
Reference in New Issue
Block a user