android文件语音英语识别
枫叶漂游 发布于2017-11-29 18:48 浏览:227 回复:1
0
收藏

android官方demo中提供文件识别,请问我想进行英语pcm文件识别,应该怎么修改?

private ArrayList<SpeechTestCase> getTests() {
ArrayList<SpeechTestCase> cases = new ArrayList<SpeechTestCase>();

Map<String, Object> defaultParams = new HashMap<String, Object>();
defaultParams.put(SpeechConstant.ACCEPT_AUDIO_VOLUME, false);
defaultParams.put(SpeechConstant.VAD, SpeechConstant.VAD_DNN);
// defaultParams.put( "lan", "en");
// =========================
Map<String, Object> params = new HashMap<String, Object>(defaultParams);
cases.add(new SpeechTestCase("firstTest", "16k_test_1.pcm", params));
// =========================
Map<String, Object> params2 = new HashMap<String, Object>(defaultParams);
cases.add(new SpeechTestCase("secondTest", "16k_test_2.pcm", params2));

Map<String, Object> params3 = new HashMap<String, Object>(defaultParams);
cases.add(new SpeechTestCase("thirdTest", "16k_test_3.pcm", params3));


cases.add(new SpeechTestCase("fourTest", "outfile.pcm", params));
return cases;
}

收藏
点赞
0
个赞
共1条回复 最后由fujiayi1984回复于2017-11-30 13:29
#2fujiayi1984回复于2017-11-30

看下demo,“在线识别”,设置里语言选择英文

0
TOP
切换版块