google语音服务注意事项

服务地址:http://www.google.com/speech-api/v1/recognize?xjerr=1&client=chromium&lang=zh-CN&maxresults=1

参考:
http://blog.csdn.net/dlangu0393/article/details/7214728
http://blog.chinaunix.net/uid-20379580-id-3060474.html
1.语音文件必须是flac格式
2.采样率可以是任何在8000和44000之间(44100),并且不具有8000或16000。 如果是出界,会得到400 HTML错误页面返回
3.google的flac也有限制,采样率22050Hz 比特率201kbps,必须是立体声双声道,如果比这个大多了就会返回错误。
4.如果识别不了,可以尝试修改采样率和比特率
5.转换文件,可以使用Java Audio Video Encoder
下载地址:http://www.sauronsoftware.it/projects/jave/index.php
参考:http://hi.baidu.com/qiuwanchilove/item/7ccc636d305a6198c5d249a5
6.flac转换重要代码(用Java Audio Video Encoder )
File target = new File(targetFile);
AudioAttributes audio = new AudioAttributes();
audio.setCodec("flac");
audio.setBitRate(new Integer(125000));
audio.setChannels(new Integer(2));
audio.setSamplingRate(new Integer(44000));
EncodingAttributes attrs = new EncodingAttributes();
attrs.setFormat("flac");
attrs.setAudioAttributes(audio);
Encoder encoder = new Encoder();
encoder.encode(source, target, attrs);
7.返回编码含义
4-丢失的音频文件
5-不正确的音频文件状态
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值