【置顶】语音识别REST API问题及答案汇总贴
0半君0 发布于2016-01 浏览:126569 回复:50
0
收藏

语音识别REST API问题及答案汇总贴

收藏
点赞
0
个赞
共50条回复 最后由用户已被禁言回复于2022-04
#11sunny小阚回复于2016-10

gpluscat:

let params: [String: AnyObject] = ["format": "wav", "rate": 8000, "channel": 1, "cuid": "ef0d06fef07e3c3f3c03853101133f79c3d6ae05", "token": token, "speech": speech, "len": len]

        Alamofire.request(.POST, "http://vop.baidu.com/server_api", parameters: params, encoding: .JSON, headers: ["Content-Type": "application/json;charset=UTF-8"]).responseJSON { (response: Response) in

            print(">>>>>>>>>>response \(response)")

        }

为什么返回3300,参数错误,并没有错呀

回复gpluscat:上传的地址是不是  url="http://vop.baidu.com/server_api"? json格式url中不要加参数

0
#10边城_量子回复于2016-10

python写的识别程序,调试通过.


def recognize( filepath, ftype, frate, token, fchannel ):

    fh = open( filepath ,'rb')

    content = fh.read()

    f_len = os.path.getsize( filepath )

    speech = base64.b64encode(content) 

    fh.close()


    # 表示本机的id,使用mac地址标识

    cuid = "40-8D-5C-73-00-78"

    url="http://vop.baidu.com/server_api"

    update = json.dumps({'format':ftype,'rate':frate,'channel':fchannel,'cuid':cuid,'token':token,'speech':speech,'len':f_len})

    r = urllib2.urlopen( url ,update)

    result = json.loads( r.read() )

    err_no = result['err_no']

    if err_no == 0:

        text = result['result'][0]

    else:

        text = err_map( err_no )

        print  "DEBUG, Error:" ,text.encode('cp936')

    return err_no, text


0
#9dengshengyx回复于2016-10

目前语言识别REST API只支持中文播报,什么时候支持如英文等语种的播报?

0
#8妖尾迷8回复于2016-09

HTTP Error 413: Request Entity Too Large

这个具体是什么问题

0
#7gpluscat回复于2016-07

let params: [String: AnyObject] = ["format": "wav", "rate": 8000, "channel": 1, "cuid": "ef0d06fef07e3c3f3c03853101133f79c3d6ae05", "token": token, "speech": speech, "len": len]

        Alamofire.request(.POST, "http://vop.baidu.com/server_api", parameters: params, encoding: .JSON, headers: ["Content-Type": "application/json;charset=UTF-8"]).responseJSON { (response: Response) in

            print(">>>>>>>>>>response \(response)")

        }

为什么返回3300,参数错误,并没有错呀

0
#6rgbhje回复于2016-04

我是用php实例做的测试语音识别功能的,有以下几个问题:


1 文件中的test.pcm,是不是就是要转换的语音文件?

2 在linux系统下怎么得到pcm语音文件

3 怎么使用mav文件进行语音识别

4 怎么提高mwa的识别率

0
#5白菜天尊回复于2016-02

测试官方例子 里面cuid需要填什么

报错

Exception in thread "main" org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]

at org.json.JSONTokener.syntaxError(JSONTokener.java:433)

at org.json.JSONObject.(JSONObject.java:197)

at org.json.JSONObject.(JSONObject.java:324)


0
#4nenge123回复于2016-02

合成的文本可以持续保存吗

0
#3水寒319回复于2016-02

问题:

REST API语音识别错误代码:3301,是什么原因?


回答:

主要原因可能有:

1、语音格式不正确。

2、语音质量有问题,模糊不清或者静音。


0
#20半君0回复于2016-01

问题:

REST API方式是否支持语义理解?


回答:

REST API方式不支持语义理解。如果想使用语义理解功能,请用SDK版本。


0
TOP
切换版块