Explorar el Código

讯飞asr测试,debug

Davidliu hace 1 mes
padre
commit
ceccaf2d81
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/core/voip/asr.py

+ 1 - 1
src/core/voip/asr.py

@@ -330,7 +330,7 @@ class XfAsr:
                     final_result['name'] = 'TranscriptionResultChanged'
                 if st['type'] == "0":
                     final_result['name'] = 'SentenceEnd'
-                final_result['result'] = ''.join(cw["w"] for item in rt for ws in item["ws"] for cw in ws["cw"])
+                final_result['result'] = ''.join(cw["w"] for item in rt for ws in item["ws"] for cw in ws["cw"]).strip()
             elif result_dict["action"] == "error":
                 self.logger.error("xunfei.Asr.recv: call_id: %s, action is error: %s", self.tid, message)
                 final_result['name'] = 'TranscriptionResultError'