返回信息流我在本地上传的各种类型的音频都是返回{"status":5,"id":"03993dd556d243a54727715f8fe1c991-1","hypotheses":[]}这一类的错误。
我用的是采样率是16kHz的flac和wav。wav的码率是256kbps。Content-Type设置成了"audio/x-flac; rate=16000"和“audio/L16; rate=16000”。但是返回的结果都是前面那个。不知道有人用过这个api吗?要怎么调用才是对的呢?
这是一条镜像帖。来源:北邮人论坛 / www-technology / #18016同步于 2012/11/3
该镜像源已超过 30 天没有更新,可能在源站已被删除。
WWWTechnology机器人发帖
小白求问google的语音识别api,有人用过吗?
liyuchen
2012/11/3镜像同步8 回复
订阅后,新回复会通过你的通知中心匿名送达。
8 条回复
应该是你哪一步出了差错.
Spinning-Tid:~ Alex$ lame --decode test.mp3 test.wav
input: test.mp3 (44.1 kHz, 1 channel, MPEG-1 Layer III)
output: test.wav (16 bit, Microsoft WAVE)
skipping initial 1105 samples (encoder+decoder delay)
skipping final 339 samples (encoder padding-decoder delay)
Frame# 65/65 128 kbps
Spinning-Tid:~ Alex$ flac -8 -f --sample-rate=16000 test.wav
flac 1.2.1, Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson
flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
welcome to redistribute it under certain conditions. Type `flac' for details.
test.wav: wrote 91795 bytes, ratio=0.625
Spinning-Tid:~ Alex$ wget -O "test.txt" --user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.26.14 (KHTML, like Gecko) Version/6.0.1 Safari/536.26.14" --post-file=test.flac --header="Content-Type: audio/x-flac; rate=16000" "http://www.google.com/speech-api/v1/recognize?xjerr=1&client=chromium&lang=en_US&maxresults=10" && cat test.txt
--2012-11-03 22:20:53-- http://www.google.com/speech-api/v1/recognize?xjerr=1&client=chromium&lang=en_US&maxresults=10
Resolving www.google.com... 74.125.141.147, 74.125.141.105, 74.125.141.104, ...
Connecting to www.google.com|74.125.141.147|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/json]
Saving to: ‘test.txt’
[ <=> ] 454 --.-K/s in 0s
2012-11-03 22:20:58 (7.87 MB/s) - ‘test.txt’ saved [454]
{"status":0,"id":"129c4a8305af1e32ae3ccea653086d29-1","hypotheses":[{"utterance":"how old Houlka MS","confidence":0.19957155},{"utterance":"how old emails"},{"utterance":"how old is the moon"},{"utterance":"how old the moon"},{"utterance":"how old need"},{"utterance":"how old how old the moon"},{"utterance":"how old how old emails"},{"utterance":"cool how old emails"},{"utterance":"how old how old is the moon"},{"utterance":"how old how old need"}]}
Spinning-Tid:~ Alex$ r test.*
【 在 liyuchen 的大作中提到: 】
: 已经试了flac不行,1楼说过了
wav 也可以... 不过我用的游戏配音是 "Get up! Get up! We're almost there!" 啊... 这准确度......... orz
Spinning-Tid:~ Alex$ wget -O "test.txt" --user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.26.14 (KHTML, like Gecko) Version/6.0.1 Safari/536.26.14" --post-file=test.wav --header="Content-Type: audio/L16; rate=16000" "http://www.google.com/speech-api/v1/recognize?xjerr=1&client=chromium&lang=en_US&maxresults=10" && cat test.txt
--2012-11-03 22:27:00-- http://www.google.com/speech-api/v1/recognize?xjerr=1&client=chromium&lang=en_US&maxresults=10
Resolving www.google.com... 74.125.141.103, 74.125.141.104, 74.125.141.105, ...
Connecting to www.google.com|74.125.141.103|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/json]
Saving to: ‘test.txt’
[ <=> ] 455 --.-K/s in 0s
2012-11-03 22:27:04 (7.35 MB/s) - ‘test.txt’ saved [455]
{"status":0,"id":"04ccdbfe9b57e3983a0318112aad1d58-1","hypotheses":[{"utterance":"how old emails","confidence":0.53578705},{"utterance":"how old Houlka MS"},{"utterance":"how old is the moon"},{"utterance":"how old the moon"},{"utterance":"how old kung fu"},{"utterance":"how old how old the moon"},{"utterance":"how old how old emails"},{"utterance":"how old kung fu fu"},{"utterance":"how old how old is the moon"},{"utterance":"cool how old emails"}]}
Spinning-Tid:~ Alex$
【 在 liyuchen 的大作中提到: 】
: 已经试了flac不行,1楼说过了
Spinning-Tid:~ Alex$ wget -O "test.txt" --user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.26.14 (KHTML, like Gecko) Version/6.0.1 Safari/536.26.14" --post-file=new_record.flac --header="Content-Type: audio/x-flac; rate=16000" "http://www.google.com/speech-api/v1/recognize?xjerr=1&client=chromium&lang=zh_CN&maxresults=10" && cat test.txt
--2012-11-04 10:46:16-- http://www.google.com/speech-api/v1/recognize?xjerr=1&client=chromium&lang=zh_CN&maxresults=10
Resolving www.google.com... 74.125.31.99, 74.125.31.105, 74.125.31.104, ...
Connecting to www.google.com|74.125.31.99|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/json]
Saving to: ‘test.txt’
[ <=> ] 413 --.-K/s in 0s
2012-11-04 10:46:17 (9.85 MB/s) - ‘test.txt’ saved [413]
{"status":0,"id":"672475615aa3be38824c089f2e7d25d9-1","hypotheses":[{"utterance":"五道口西单","confidence":0.7241605},{"utterance":"五道口西丹"},{"utterance":"五道口西班"},{"utterance":"五道口西单"},{"utterance":"五道口西餐"},{"utterance":"五道口西旦"},{"utterance":"五道口西蛋"},{"utterance":"五道口西的"},{"utterance":"五道口西段"},{"utterance":"五道口西达"}]}
Spinning-Tid:~ Alex$
【 在 liyuchen 的大作中提到: 】
: 麻烦你能不能帮我试一下这个flac能不能被识别?是个中文的
可能是你链接用错了... 于是只剩下这一个可能性了.
【 在 liyuchen 的大作中提到: 】
: 麻烦你能不能帮我试一下这个flac能不能被识别?是个中文的