void OnGUI() { if (Application.platform == RuntimePlatform.Android) { if (GUI.Button(new Rect(Screen.width / 2, Screen.height / 2 - 200, 200, 150), "Start Speech")) { SpeakNow.startSpeech(LanguageUtil.JAPANESE); } if (GUI.Button(new Rect(Screen.width / 2, Screen.height / 2, 200, 150), "Reset")) { if (checkSpeak(SpeakNow.speechResult().ToString().Trim())) { // GUI.Label(new Rect(Screen.width / 2, Screen.height / 2 + 350, 200, 200), " Exactly "); incDem(); updateQuestSpeak(dem); SpeakNow.reset(); } //else // GUI.Label(new Rect(Screen.width / 2, Screen.height / 2 + 450, 200, 200), " no correct "); } GUI.Label(new Rect(Screen.width / 2, Screen.height / 2 + 230, 200, 200), "Speech Result : " + SpeakNow.speechResult()); GUI.Label(new Rect(Screen.width / 2, Screen.height / 2 + 260, 200, 200), "Quest : " + result); GUI.Label(new Rect(Screen.width / 2, Screen.height / 2 + 350, 200, 200), checkSpeak(SpeakNow.speechResult().ToString().Trim()) ? "Exactly" : " no correct"); } else { GUI.Label(new Rect(Screen.width / 2, Screen.height / 2, 300, 200), "Please Build and Run in Android and see documentation for usage of functionalities."); } }
private void OnMouseUp() { if (type == typeBotton.buttonStartSpeak) { SpeakNow.startSpeech(LanguageUtil.JAPANESE); creategameOver = true; } if (type == typeBotton.buttonCheckSpeak) { if (questSpeak.GetComponent <QuestSpeak>().checkSpeak(SpeakNow.speechResult().ToString().Trim())) { playerSpeak.GetComponent <PlayerSpeak>().pointSpeak++; questSpeak.GetComponent <QuestSpeak>().incDem(); questSpeak.GetComponent <QuestSpeak>().updateQuestSpeak(questSpeak.GetComponent <QuestSpeak>().dem); SpeakNow.reset(); } } }
void OnGUI() { if (Application.platform == RuntimePlatform.Android) { if (GUI.Button(new Rect(Screen.width / 2, Screen.height / 2 - 200, 200, 150), "Start Speech")) { SpeakNow.startSpeech(LanguageUtil.ENGLISH_US); } if (GUI.Button(new Rect(Screen.width / 2, Screen.height / 2, 200, 150), "Reset")) { SpeakNow.reset(); } GUI.Label(new Rect(Screen.width / 2, Screen.height / 2 + 230, 200, 200), "Speech Result : " + SpeakNow.speechResult()); GUI.Label(new Rect(Screen.width / 2, Screen.height / 2 + 260, 200, 200), SpeakNow.getConfidenceScore().Length > 0?"Confidence Score : " + SpeakNow.getConfidenceScore():""); GUI.Label(new Rect(Screen.width / 2, Screen.height / 2 + 350, 200, 200), SpeakNow.isResultMatches("almost") ? "Matched : " + SpeakNow.isResultMatches("almost") : ""); } else { GUI.Label(new Rect(Screen.width / 2, Screen.height / 2, 300, 200), "Please Build and Run in Android and see documentation for usage of functionalities."); } }
public void mulaiSpeech() { SpeakNow.startSpeech(LanguageUtil.INDONESIAN); btn_startSpeak.GetComponent <Image>().color = Color.green; }