private void CapTouchCallback(ICapTouchEvent capTouchEvent) { //Only processing contacted events if (capTouchEvent.IsContacted) { switch (capTouchEvent.SensorPosition) { case CapTouchPosition.Back: _assetHelper.PlaySystemSound(SystemSound.Amazement); _assetHelper.ShowSystemImage(SystemImage.Amazement); break; case CapTouchPosition.Front: _assetHelper.PlaySystemSound(SystemSound.PhraseHello); _assetHelper.ShowSystemImage(SystemImage.ContentRight); break; case CapTouchPosition.Right: _assetHelper.PlaySystemSound(SystemSound.Joy); _assetHelper.ShowSystemImage(SystemImage.Joy2); break; case CapTouchPosition.Left: _assetHelper.PlaySystemSound(SystemSound.Love); _assetHelper.ShowSystemImage(SystemImage.Love); break; case CapTouchPosition.Scruff: _assetHelper.PlaySystemSound(SystemSound.PhraseEvilAhHa); _assetHelper.ShowSystemImage(SystemImage.Rage); break; case CapTouchPosition.Chin: _assetHelper.PlaySystemSound(SystemSound.Sleepy); _assetHelper.ShowSystemImage(SystemImage.Sleepy); break; } } }
/// <summary> /// Callback called when a cap touch sensor is contacted or released /// This method only process IsContacted events /// </summary> /// <param name="capTouchEvent"></param> private void CapTouchCallback(ICapTouchEvent capTouchEvent) { if(capTouchEvent.IsContacted) { switch (capTouchEvent.SensorPosition) { case CapTouchPosition.Back: _misty.PlayAudio("s_Love.wav", 100, null); _misty.DisplayImage("e_Love.jpg", 1 , null); _misty.Speak("Thats nice", true, "1", null); break; case CapTouchPosition.Front: _misty.PlayAudio("s_Amazement.wav", 100, null); _misty.DisplayImage("e_Amazement.jpg", 1, null); _misty.Speak("I am amazed", true, "1", null); break; case CapTouchPosition.Right: _misty.PlayAudio("s_Joy.wav", 100, null); _misty.DisplayImage("e_JoyGoofy3.jpg", 1, null); _misty.Speak("Oh Woopie!", true, "1", null); break; case CapTouchPosition.Left: _misty.PlayAudio("e_Terror.jpg", 100, null); _misty.DisplayImage("s_Fear.wav", 1, null); _misty.Speak("Get away from me!", true, "1", null); break; case CapTouchPosition.Scruff: _misty.PlayAudio("s_Rage.wav", 100, null); _misty.DisplayImage("e_Rage4.jpg", 1, null); _misty.Speak("I will kick your ass!", true, "1", null); break; case CapTouchPosition.Chin: _misty.PlayAudio("s_Sleepy.wav", 100, null); _misty.DisplayImage("e_Sleepy2.jpg", 1, null); _misty.Speak("I am feeling sleepy", true, "1", null); break; } } }
/// <summary> /// Callback called when a cap touch sensor is contacted or released /// This method only process IsContacted events /// </summary> /// <param name="capTouchEvent"></param> private void CapTouchCallback(ICapTouchEvent capTouchEvent) { if (capTouchEvent.IsContacted) { switch (capTouchEvent.SensorPosition) { case CapTouchPosition.Back: _misty.PlayAudio("s_Love.wav", 100, null); _misty.DisplayImage("e_Love.jpg", 1, null); break; case CapTouchPosition.Front: _misty.PlayAudio("s_Amazement.wav", 100, null); _misty.DisplayImage("e_Amazement.jpg", 1, null); break; case CapTouchPosition.Right: _misty.PlayAudio("Joy.wav", 100, null); _misty.DisplayImage("JoyGoofy3.jpg", 1, null); break; case CapTouchPosition.Left: _misty.PlayAudio("s_Fear.wav", 100, null); _misty.DisplayImage("e_Terror.jpg", 1, null); break; case CapTouchPosition.Scruff: _misty.PlayAudio("s_Rage.wav", 100, null); _misty.DisplayImage("e_Rage4.jpg", 1, null); break; case CapTouchPosition.Chin: _misty.PlayAudio("s_Sleepy.wav", 100, null); _misty.DisplayImage("e_Sleepy2.jpg", 1, null); break; } } }
private void onTouched(ICapTouchEvent capTouchEvent) { _misty.RegisterVoiceRecordEvent(OnVoiceRecordReceived, 10, false, "VoiceRecordEvent", null); _misty.StartKeyPhraseRecognition(true, true, 10000, 5000, null); }