python 百度语音识别API 和腾讯云识别API百度语音识别API 需要先去注册百度语音识别获取到个人的APP_ID、API_KEY、SECRET_KEY 安装百度API包pip install baidu-aip 样例代码 from aip import AipSpeech APP_ID = '********' API_KEY = '************' SECRET_KEY = '****************' client = AipSpeech(APP_ID, API_KEY, SECRET_KEY) # 识别本地文件 res = client.asr(get_file_content("文件路径"), 'wav', 16000, { 'dev_pid': 1537, # 默认1537(普通话 输入法模型) }) print(res.get("result")[0]) 说明 format string 必填 语音文件的格式,pcm/wav/am
一只胖橘