语音识别音频格式 [英] Speech Recognition Audio Format

查看:114
本文介绍了语音识别音频格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一些帮助才能使语音识别REST API正常工作。  每当我发布一个音频文件时,来自服务器的响应总是只是"错误"。没有其他信息。  支持哪些音频格式?  我只是使用
WAV文件在常规音频播放器中播放。

I need some help getting the speech recognition REST API working.  Whenever I POST an audio file the response from the server is always just "error" with no other information.  What audio formats are supported?  I'm just using a WAV file that plays in regular audio players.

目前我只是试图从命令行开始工作。  我可以发出oauth请求并取回访问令牌,然后我发出此请求:

Currently I'm just trying to get this to work from the command line.  I can make the oauth request and get back the access token, then I make this request:

curl -v -H" Authorization:Bearer xxx" -H"Content-Type:audio / wav; samplerate = 16000" -X POST -d @ / code / util / shared / Audio / directions_fairfax_avenue.wav'https://speech.platform.bing.com/recognize?version=3.0&requestid=7068f1fa-35c6-4e41-8301-cfe494f70787& APPID = D4D52672-91D7-4C74-8AD8-42B1D98141A5&安培;格式= JSON&安培;语言环境= EN-US&安培; device.os = centos7&安培;场景=乌尔姆&安培;实例id = 61640c2c-9fc0-4259-bc6e-d8860ed64eb5&安培; maxnbest = 3'

curl -v -H "Authorization:Bearer xxx" -H "Content-Type:audio/wav;samplerate=16000" -X POST -d @/code/util/shared/Audio/directions_fairfax_avenue.wav 'https://speech.platform.bing.com/recognize?version=3.0&requestid=7068f1fa-35c6-4e41-8301-cfe494f70787&appID=D4D52672-91D7-4C74-8AD8-42B1D98141A5&format=json&locale=en-us&device.os=centos7&scenarios=ulm&instanceid=61640c2c-9fc0-4259-bc6e-d8860ed64eb5&maxnbest=3'

这总是我得到的答案:

{" version":" 3.0"," header":{" status" ;:"错误","属性":{" requestid":" bda6c8d5-8651-4e45-9457-420f925607eb"}}}

{"version":"3.0","header":{"status":"error","properties":{"requestid":"bda6c8d5-8651-4e45-9457-420f925607eb"}}}

我是否有查询字符串参数错了?  音频文件有问题吗?

Do I have a query string parameter wrong?  Is there something wrong with the audio file?

谢谢!

Nick

Thanks!
Nick

推荐答案

嗨尼克,

你在这里没有得到回应真是令人厌恶。

It is quite disgusting that you never got a response in here.

一般来说,音频所需格式为PCM,16Bit Mono WAV文件。

In general, the audio format required is PCM, 16Bit Mono WAV file.

干杯


这篇关于语音识别音频格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆