lschen 10 сар өмнө
parent
commit
8998d9b118
1 өөрчлөгдсөн 3 нэмэгдсэн , 0 устгасан
  1. 3 0
      lib_grpc.py

+ 3 - 0
lib_grpc.py

@@ -89,6 +89,9 @@ class AudioRecorderClient(QObject):
                 # 发射信号,将缓存的中间结果和最后一次的结果一起发送
                 # self.trigger.emit(ans_str_cache + response.ansStr)
 
+                # 关闭grpc连接
+                self.channel.close()
+
                 # 如果使用后断点识别,因为没有主动调用stop_speech发送endFlag=True,需要在接收到引擎的endFlag标记时,清空request_queue
                 if self.vad_flag:
                     self.request_queue.put(None)