本文整理汇总了Java中com.iflytek.cloud.SpeechRecognizer.startListening方法的典型用法代码示例。如果您正苦于以下问题:Java SpeechRecognizer.startListening方法的具体用法?Java SpeechRecognizer.startListening怎么用?Java SpeechRecognizer.startListening使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.iflytek.cloud.SpeechRecognizer
的用法示例。
在下文中一共展示了SpeechRecognizer.startListening方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startListening
import com.iflytek.cloud.SpeechRecognizer; //导入方法依赖的package包/类
private void startListening(JSONObject options, CallbackContext callbackContext) {
Log.v(TAG,"startListening " + String.valueOf(options));
SpeechRecognizer rec = getRecognizer();
rec.setParameter(SpeechConstant.DOMAIN, "iat");
rec.setParameter(SpeechConstant.LANGUAGE, "zh_cn");
rec.setParameter(SpeechConstant.ACCENT, "mandarin");
rec.setParameter(SpeechConstant.ASR_AUDIO_PATH, ASR_FILE);
if (options != null) {
Iterator it = options.keys();
while (it.hasNext()) {
String key = (String) it.next();
String value = options.optString(key);
rec.setParameter(key, value);
}
}
rec.startListening(this);
}
示例2: startListening
import com.iflytek.cloud.SpeechRecognizer; //导入方法依赖的package包/类
private void startListening(JSONObject options, CallbackContext callbackContext) {
SpeechRecognizer rec = getRecognizer();
rec.setParameter(SpeechConstant.DOMAIN, "iat");
rec.setParameter(SpeechConstant.LANGUAGE, "zh_cn");
rec.setParameter(SpeechConstant.ACCENT, "mandarin");
rec.setParameter(SpeechConstant.ASR_AUDIO_PATH, ASR_FILE);
if (options != null) {
Iterator it = options.keys();
while (it.hasNext()) {
String key = (String) it.next();
String value = options.optString(key);
rec.setParameter(key, value);
}
}
rec.startListening(this);
}
示例3: xfVoice
import com.iflytek.cloud.SpeechRecognizer; //导入方法依赖的package包/类
public void xfVoice(View view) {
SpeechRecognizer mIat = SpeechRecognizer.createRecognizer(context, mInitListener);
//2.设置听写参数,详见《科大讯飞MSC API手册(Android)》SpeechConstant类
mIat.setParameter(SpeechConstant.DOMAIN, "iat");
mIat.setParameter(SpeechConstant.LANGUAGE, "zh_cn");
mIat.setParameter(SpeechConstant.ACCENT, "mandarin ");
mIat.setParameter(SpeechConstant.ASR_PTT, "0");
//3.开始听写
mIat.startListening(mRecoListener);
}