def recognize_speech(self):
"""
send recognize speech event and process the response
:param speech: file-like containing speech for request
:param mic_stop_event: threading.Event when speech is an infinite stream, to monitor for signal from
downchannel stream to end the recognize request.
"""
if self.speech_profile not in SPEECH_CLOUD_ENDPOINTING_PROFILES:
if self.expect_speech_timeout_event:
self.scheduler.cancel(self.expect_speech_timeout_event)
self._audio_input_device.start_recording()
self.handle_parts(self.send_event_parse_response(self._generate_recognize_payload(self._audio_input_device)))
logger.debug("Recognize dialog ID: {}".format(self._current_dialog_request_id))
评论列表
文章目录