(self)
| 194 | print("rec_file",e) |
| 195 | return |
| 196 | def wait_for_result(self): |
| 197 | try: |
| 198 | timeout=self.timeout |
| 199 | |
| 200 | file_dur=self.rec_file_len/16000/2*100 |
| 201 | if file_dur>timeout: |
| 202 | timeout=file_dur |
| 203 | self.timeout=timeout |
| 204 | #print("wait_for_result timeout=",timeout) |
| 205 | |
| 206 | # if file_dur==0 means in stream way and no timeout |
| 207 | while(self.is_final==False and (timeout>0 or file_dur==0 )): |
| 208 | time.sleep(0.01) |
| 209 | timeout=timeout-1 |
| 210 | |
| 211 | if timeout<=0 and not file_dur==0: |
| 212 | print("time out!",self.timeout) |
| 213 | except Exception as e: |
| 214 | print("wait_for_result",e) |
| 215 | return |
| 216 | def get_result(self): |
| 217 | try: |
| 218 | message = json.dumps({"is_speaking": False}) |
no outgoing calls
no test coverage detected