准备语音流到文本

时间:2020-03-27 21:25:14

标签: azure stream inputstream speech-to-text streamwriter

我正在尝试使用以下逻辑将流以天蓝色语音发送到文本上

    def get_speechstream_text_async(self,stream):

        try:
            print('push shart')
            stream_format= speechsdk.audio.AudioStreamFormat()
            custom_stream= speechsdk.audio.PushAudioInputStream(stream_format)
            print('again end')
            custom_stream.write(stream)
            print('push end')

            audio_config = speechsdk.audio.AudioConfig(stream=custom_stream)
            speech_recognizer = speechsdk.SpeechRecognizer(speech_config=self.speech_config, audio_config=audio_config) 

当我尝试订阅流时,出现此错误:

error in method 'PushAudioInputStream_write', argument 2 of type '(TYPEMAP, SIZE)'

有人可以帮助您解决问题是什么以及如何传递以将语音转换为文本吗?

0 个答案:

没有答案