|
@@ -69,7 +69,6 @@ class MyAudioMediaPort(pj.AudioMediaPort):
|
|
|
self.audio_media = audio_media
|
|
|
self.asr = asr
|
|
|
self.first = True
|
|
|
- self.counter = 0
|
|
|
|
|
|
self.user_asr_texts = []
|
|
|
|
|
@@ -81,12 +80,9 @@ class MyAudioMediaPort(pj.AudioMediaPort):
|
|
|
def onFrameReceived(self, frame):
|
|
|
# self.wav.writeframes(bytes(frame.buf))
|
|
|
if self.asr: # 如果ASR实例存在,则发送音频数据
|
|
|
- if self.first:
|
|
|
- self.first = False
|
|
|
- self.call.logger.warn("Received audio frame: %s, %s, %s", self.call.session_id,frame.buf,frame.size)
|
|
|
- if self.counter % 200 ==0:
|
|
|
- self.call.logger.warn("Received audio frame: %s, %s, %s", self.call.session_id, frame.buf, frame.size)
|
|
|
- self.counter += 1
|
|
|
+ # if self.first:
|
|
|
+ # self.first = False
|
|
|
+ self.call.logger.warn("Received audio frame: %s, %s, %s", self.call.session_id,frame.buf,frame.size)
|
|
|
self.asr.send_audio(frame.buf)
|
|
|
|
|
|
try:
|