android audiorecord 录音内容 调用rest api 完全不能识别
csonnet 发布于2017-04 浏览:1457 回复:1
0
收藏

我使用的服务是:语音识别

调用的接口是:rest api

参数设置情况:

conn2.setRequestMethod("POST");
conn2.setRequestProperty("Content-Type", "audio/pcm; rate=8000");

开发平台和机型:android

SDK版本号:无

代码或日志截图(上传截图能帮助您更快解决问题):

复现步骤、现象及其他描述:

我用audiorecord 8000的采样率  如下参数录音,调用rest接口上传,但完全不能识别任何内容

int audioSource=MediaRecorder.AudioSource.MIC ;
int frequency = 8000;
int channelConfiguration = AudioFormat.CHANNEL_IN_MONO;
int audioEncoding = AudioFormat.ENCODING_PCM_16BIT ;



后来我用demo的 test.pcm ,上传是可以正常识别的。


audiorecord录音内容需要特别处理吗?

收藏
点赞
0
个赞
共1条回复 最后由用户已被禁言回复于2022-04
#2fujiayi1984回复于2017-04

csonnet:

我使用的服务是:语音识别

调用的接口是:rest api

参数设置情况:

conn2.setRequestMethod("POST");
conn2.setRequestProperty("Content-Type", "audio/pcm; rate=8000");

开发平台和机型:android

SDK版本号:无

代码或日志截图(上传截图能帮助您更快解决问题):

复现步骤、现象及其他描述:

我用audiorecord 8000的采样率  如下参数录音,调用rest接口上传,但完全不能识别任何内容

int audioSource=MediaRecorder.AudioSource.MIC ;
int frequency = 8000;
int channelConfiguration = AudioFormat.CHANNEL_IN_MONO;
int audioEncoding = AudioFormat.ENCODING_PCM_16BIT ;



后来我用demo的 test.pcm ,上传是可以正常识别的。


audiorecord录音内容需要特别处理吗?

回复csonnet:

建议您使用cool edit等音频软件对比下您录制下来的pcm文件和test.pcm

0
TOP
切换版块