Browse Source

讯飞asr测试,debug

Davidliu 1 month ago
parent
commit
6b5f26eee3
2 changed files with 4 additions and 18 deletions
  1. 0 1
      src/core/voip/bot.py
  2. 4 17
      src/core/voip/constant.py

+ 0 - 1
src/core/voip/bot.py

@@ -203,7 +203,6 @@ class MyCall(pj.Call):
         self.call_phone = kwargs.get("Caller-Caller-ID-Number")
         self.logger.info("daviddebugger::self.session_id:%s, self.call_phone:%s", self.session_id,self.call_phone)
         self.taskId = "10001"
-        # self.scripts = build_demo_script()
         self.user_asr_text_queue = queue.Queue(maxsize=100)
         self.message_queue = queue.Queue(maxsize=3)
         self.player_complete_dict = {}

+ 4 - 17
src/core/voip/constant.py

@@ -1,18 +1,9 @@
 #!/usr/bin/env python3
 # encoding:utf-8
 
-import os
 import mmh3
-import queue
 import pjsua2 as pj
 
-player_script_dir = '/code/src/core/voip/scripts/'
-
-
-def murmur3_32(player_file):
-    if isinstance(player_file, list):
-        player_file = ','.join(player_file)
-    return abs(mmh3.hash(player_file))
 
 def build_ep_config():
     ep_cfg = pj.EpConfig()
@@ -74,11 +65,7 @@ def build_audio_format():
     # fmt.frameTimeUsec = 20000
     return fmt
 
-
-def build_demo_script():
-    res = queue.Queue(maxsize=10)
-    for file in os.listdir(player_script_dir):
-        file = os.path.join(player_script_dir, file)
-        print('build_demo_script::', file)
-        res.put(file)
-    return res
+def murmur3_32(player_file):
+    if isinstance(player_file, list):
+        player_file = ','.join(player_file)
+    return abs(mmh3.hash(player_file))