我正在尝试使用Azure认知语音服务处理.wav文件。我正在使用下面的脚本。当我试图通过调用AudioConfig.FromWavFileInput()来设置wav文件时,出现了一个异常:“类型对象‘AudioConfig’没有属性‘FromWavFileInput’”。文档显示该函数存在,至少在.net库中是这样。cognitiveservices-speech python library是否存在FromWaveFileInput?如何使用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)
确实如你所说。我在GitHub repo ^{} 上搜索了关键字
AudioConfig
&;FromWavFileInput
,除了Java、C#和C++,没有任何关于它的Python代码。在根据我的经验,有两种解决方法。在
相关问题 更多 >
编程相关推荐