try {
// you must have android.permission.RECORD_AUDIO granted at this point
Speech.getInstance().startListening(new SpeechDelegate() {
@Override
public void onStartOfSpeech() {
Log.i("speech", "speech recognition is now active");
}
@Override
public void onSpeechRmsChanged(float value) {
Log.d("speech", "rms is now: " + value);
}
@Override
public void onSpeechPartialResults(List<String> results) {
StringBuilder str = new StringBuilder();
for (String res : results) {
str.append(res).append(" ");
}
Log.i("speech", "partial result: " + str.toString().trim());
}
@Override
public void onSpeechResult(String result) {
Log.i("speech", "result: " + result);
}
});
} catch (SpeechRecognitionNotAvailable exc) {
Log.e("speech", "Speech recognition is not available on this device!");
// You can prompt the user if he wants to install Google App to have
// speech recognition, and then you can simply call:
//
// SpeechUtil.redirectUserToGoogleAppOnPlayStore(this);
//
// to redirect the user to the Google App page on Play Store
} catch (GoogleVoiceTypingDisabledException exc) {
Log.e("speech", "Google voice typing must be enabled!");
}
ส่วนการเปรียบเทียบองศึกษาผ่านตัวนี้ดูนะครับ
accepted
For Google Cloud Speech refer the following link.
https://cloud.google.com/speech/
-It support 80 different language
-we can Recognize audio uploaded in the request
-Return Text Results In Real-Time
-Accurate In Noisy Environments
-Works with apps across any device
-Not Free,Please refer following link
-https://cloud.google.com/speech/pricing
For Android Speech to Text API (Recognizer Intent) refer the following link.
-Need to Pass local language to convert Sppech to text.
-Right No all the devices are not supporting offline speech input
-We can not pass audio file to recognize.
-Intent return array of string which match to out input.We can consider first one as th most accurate.
-Work with Android Phone
-Free