|
@@ -91,8 +91,10 @@ class MyAudioMediaPort(pj.AudioMediaPort):
|
|
|
else:
|
|
|
if asr_text and not play_complete:
|
|
|
self.user_asr_texts.append(asr_text)
|
|
|
- if asr_text and play_complete:
|
|
|
- self.user_asr_texts.append(asr_text)
|
|
|
+ if asr_text and play_complete or play_complete and self.user_asr_texts:
|
|
|
+ if asr_text: # 等价于 if asr_text is not None and asr_text != ""
|
|
|
+ self.user_asr_texts.append(asr_text)
|
|
|
+ # self.user_asr_texts.append(asr_text)
|
|
|
user_asr_text = asr_text if len(self.user_asr_texts) == 1 else '###'.join(self.user_asr_texts)
|
|
|
self.user_asr_texts.clear()
|
|
|
self.call.chat(user_asr_text)
|
|
@@ -232,6 +234,7 @@ class MyCall(pj.Call):
|
|
|
def reset_wait_time(self):
|
|
|
self.play_complete_flag = False # 重置播放完成标志
|
|
|
self.play_start_time = None # 重置开始计时时间
|
|
|
+ self.digit = ''
|
|
|
def get_phone(self):
|
|
|
import re
|
|
|
call_info = self.getInfo()
|