forked from GitHub/gf-core
a bit of cleanup in the Android app
This commit is contained in:
@@ -28,8 +28,6 @@ public class MainActivity extends Activity {
|
|||||||
private static final boolean DBG = true;
|
private static final boolean DBG = true;
|
||||||
private static final String TAG = "MainActivity";
|
private static final String TAG = "MainActivity";
|
||||||
|
|
||||||
private static final boolean FAKE_SPEECH = false;
|
|
||||||
|
|
||||||
private ImageView mStartStopButton;
|
private ImageView mStartStopButton;
|
||||||
|
|
||||||
private ConversationView mConversationView;
|
private ConversationView mConversationView;
|
||||||
@@ -222,11 +220,6 @@ public class MainActivity extends Activity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void startRecognition() {
|
private void startRecognition() {
|
||||||
if (FAKE_SPEECH) {
|
|
||||||
handleSpeechInput("where is the hotel");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (input_mode) {
|
if (input_mode) {
|
||||||
mConversationView.addFirstPersonUtterance("...");
|
mConversationView.addFirstPersonUtterance("...");
|
||||||
mAsr.setLanguage(getSourceLanguageCode());
|
mAsr.setLanguage(getSourceLanguageCode());
|
||||||
@@ -266,10 +259,7 @@ public class MainActivity extends Activity {
|
|||||||
private void outputText(String text) {
|
private void outputText(String text) {
|
||||||
if (DBG) Log.d(TAG, "Speaking: " + text);
|
if (DBG) Log.d(TAG, "Speaking: " + text);
|
||||||
mConversationView.addSecondPersonUtterance(text);
|
mConversationView.addSecondPersonUtterance(text);
|
||||||
if (!FAKE_SPEECH) {
|
mTts.speak(getTargetLanguageCode(), text);
|
||||||
mTts.setLanguage(getTargetLanguageCode());
|
|
||||||
mTts.speak(text);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class SpeechInputListener implements ASR.Listener {
|
private class SpeechInputListener implements ASR.Listener {
|
||||||
|
|||||||
Reference in New Issue
Block a user