修复声音播放问题
1、修复唇形算法运行出错而导致的声音不播放问题。
This commit is contained in:
parent
8a4c9d7329
commit
5c5e9d08bd
@ -142,6 +142,10 @@ Fay(服务端)与数字人的通讯接口: [`ws://127.0.0.1:10002`](ws://127
|
|||||||
|
|
||||||
|
|
||||||
## **三、升级日志**
|
## **三、升级日志**
|
||||||
|
**2023.07.05:**
|
||||||
|
|
||||||
|
+ 修复无法运行唇型算法而导致的不播放声音问题。
|
||||||
|
|
||||||
**2023.06.28:**
|
**2023.06.28:**
|
||||||
|
|
||||||
+ 重构NLP模块管理逻辑,便于自由扩展;
|
+ 重构NLP模块管理逻辑,便于自由扩展;
|
||||||
|
@ -104,11 +104,13 @@ class Recorder:
|
|||||||
data = stream.read(1024, exception_on_overflow=False)
|
data = stream.read(1024, exception_on_overflow=False)
|
||||||
if not data:
|
if not data:
|
||||||
continue
|
continue
|
||||||
#只获取第一声道
|
|
||||||
data = np.frombuffer(data, dtype=np.int16)
|
if cfg.config['source']['record'].get("channels"):
|
||||||
data = np.reshape(data, (-1, cfg.config['source']['record']['channels'])) # reshaping the array to split the channels
|
#只获取第一声道
|
||||||
mono = data[:, 0] # taking the first channel
|
data = np.frombuffer(data, dtype=np.int16)
|
||||||
data = mono.tobytes()
|
data = np.reshape(data, (-1, cfg.config['source']['record']['channels'])) # reshaping the array to split the channels
|
||||||
|
mono = data[:, 0] # taking the first channel
|
||||||
|
data = mono.tobytes()
|
||||||
|
|
||||||
level = audioop.rms(data, 2)
|
level = audioop.rms(data, 2)
|
||||||
if len(self.__history_data) >= 5:
|
if len(self.__history_data) >= 5:
|
||||||
|
@ -164,9 +164,9 @@ def stop():
|
|||||||
if recorderListener is not None:
|
if recorderListener is not None:
|
||||||
util.log(1, '正在关闭录音服务...')
|
util.log(1, '正在关闭录音服务...')
|
||||||
recorderListener.stop()
|
recorderListener.stop()
|
||||||
# if deviceInputListener is not None:
|
if deviceInputListener is not None:
|
||||||
# util.log(1, '正在关闭远程音频输入输出服务...')
|
util.log(1, '正在关闭远程音频输入输出服务...')
|
||||||
# deviceInputListener.stop()
|
deviceInputListener.stop()
|
||||||
util.log(1, '正在关闭核心服务...')
|
util.log(1, '正在关闭核心服务...')
|
||||||
feiFei.stop()
|
feiFei.stop()
|
||||||
util.log(1, '服务已关闭!')
|
util.log(1, '服务已关闭!')
|
||||||
@ -196,9 +196,9 @@ def start():
|
|||||||
recorderListener.start()
|
recorderListener.start()
|
||||||
|
|
||||||
#edit by xszyou on 20230113:通过此服务来连接k210、手机等音频输入设备
|
#edit by xszyou on 20230113:通过此服务来连接k210、手机等音频输入设备
|
||||||
# util.log(1,'开启远程设备音频输入服务...')
|
util.log(1,'开启远程设备音频输入服务...')
|
||||||
# deviceInputListener = DeviceInputListener(feiFei) # 设备音频输入输出麦克风
|
deviceInputListener = DeviceInputListener(feiFei) # 设备音频输入输出麦克风
|
||||||
# deviceInputListener.start()
|
deviceInputListener.start()
|
||||||
|
|
||||||
util.log(1, '注册命令...')
|
util.log(1, '注册命令...')
|
||||||
MyThread(target=console_listener).start() # 监听控制台
|
MyThread(target=console_listener).start() # 监听控制台
|
||||||
|
@ -24,6 +24,9 @@ class MainWindow(QMainWindow):
|
|||||||
self.showMaximized()
|
self.showMaximized()
|
||||||
# self.center()
|
# self.center()
|
||||||
self.browser = QWebEngineView()
|
self.browser = QWebEngineView()
|
||||||
|
#清空缓存
|
||||||
|
# profile = QWebEngineProfile.defaultProfile()
|
||||||
|
# profile.clearHttpCache()
|
||||||
self.browser.load(QUrl('http://127.0.0.1:5000'))
|
self.browser.load(QUrl('http://127.0.0.1:5000'))
|
||||||
self.setCentralWidget(self.browser)
|
self.setCentralWidget(self.browser)
|
||||||
MyThread(target=self.runnable).start()
|
MyThread(target=self.runnable).start()
|
||||||
|
24
system.conf
24
system.conf
@ -20,28 +20,26 @@ ms_tts_region=
|
|||||||
xf_ltp_app_id=
|
xf_ltp_app_id=
|
||||||
xf_ltp_api_key=
|
xf_ltp_api_key=
|
||||||
|
|
||||||
#NLP五选一:yuan、gpt、chatgpt、rasa(需启动chatglm及rasa,https://m.bilibili.com/video/BV1D14y1f7pr)、lingju
|
#NLP多选一:lingju、yuan、gpt、chatgpt、rasa(需启动chatglm及rasa,https://m.bilibili.com/video/BV1D14y1f7pr)、VisualGLM
|
||||||
chat_module=lingju
|
chat_module=lingju
|
||||||
|
|
||||||
|
#灵聚 服务密钥(NLP多选1) https://open.lingju.ai
|
||||||
|
lingju_api_key=
|
||||||
|
lingju_api_authcode=
|
||||||
|
|
||||||
#浪.潮源大模型 服务密钥(NLP5选1) https://air.inspur.com/
|
#浪.潮源大模型 服务密钥(NLP多选1) https://air.inspur.com/
|
||||||
yuan_1_0_account=
|
yuan_1_0_account=
|
||||||
yuan_1_0_phone=
|
yuan_1_0_phone=
|
||||||
|
|
||||||
#gpt 服务密钥(NLP5选1) https://openai.com/
|
#gpt 服务密钥(NLP多选1) https://openai.com/
|
||||||
chatgpt_api_key=
|
chatgpt_api_key=
|
||||||
|
|
||||||
#灵聚 服务密钥 https://open.lingju.ai
|
#ChatGPT对接(NLP多选1)(非必须,https://chat.openai.com登录后访问https://chat.openai.com/api/auth/session获取)
|
||||||
lingju_api_key=
|
gpt_access_token=
|
||||||
lingju_api_authcode=
|
gpt_conversation_id=
|
||||||
|
#gpt代理
|
||||||
|
proxy_config=http://127.0.0.1:7890
|
||||||
|
|
||||||
#ngrok内网穿透id,远程设备可以通过互联网连接Fay(非必须)http://ngrok.cc
|
#ngrok内网穿透id,远程设备可以通过互联网连接Fay(非必须)http://ngrok.cc
|
||||||
ngrok_cc_id=
|
ngrok_cc_id=
|
||||||
|
|
||||||
#revChatGPT对接(非必须,https://chat.openai.com登录后访问https://chat.openai.com/api/auth/session获取)
|
|
||||||
gpt_access_token=
|
|
||||||
gpt_conversation_id=
|
|
||||||
|
|
||||||
#gpt代理
|
|
||||||
proxy_config=http://192.168.1.13:7890
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user