I am using azure speech to text service using python to process bunch of audios. In order to process the audios, These are the steps performed-
Rather than downloading to local machine, I want to get the file from server and pass it directly to speech to text service. For which,
I stored the audio in bytes
form in audio buffer like this- raw_audio = my_audio_in_bytes # class <'bytes'>
Then, I pass the audiobuffer to AudioConfig(filename = raw_audio) - It doesn't works. Because it expects a filepath
Is there a way to pass audiobuffer to this service?
Configuration python code:
speech_config = speechsdk.SpeechConfig(subscription=speech_key, region=service_region)
audio_config = speechsdk.audio.AudioConfig(filename='C:/audios/audio1.wav')
speech_recognizer = speechsdk.SpeechRecognizer(speech_config=speech_config, audio_config=audio_config)
@user1990, per our discussion on this GitHub issue, please use batch transcription, as Speech SDK does not directly support recognizing from a WAV file hosted on a web service (you will first need to download it locally).