我正在尝试使用Azure认知语音服务处理.wav文件。我正在使用下面的脚本。当我试图通过调用
AudioConfig.FromWavFileInput()
. 文档说明函数至少存在于.NET库中。是否存在
cognitiveservices-speech python library
? 如何使用python处理音频文件?
import azure.cognitiveservices.speech as speechsdk
speechKey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
service_region = 'eastus2'
#### # Creates an instance of a speech config with specified subscription key and service region.
#### # Replace with your own subscription key and service region (e.g., "westus").
speech_config = speechsdk.SpeechConfig(subscription=speechKey, region=service_region)
audioInput = speechsdk.AudioConfig.FromWavFileInput('RainSpain.wav')
#### # Creates a recognizer with the given settings
speech_recognizer = speechsdk.SpeechRecognizer(speech_config=speech_config, audio_input=audioInput)