Created
September 17, 2020 15:57
-
-
Save martindevans/e8541d6b50f750446e4d5500ae32d884 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Dissonance.VAD; | |
// Create a class to receive the event callbacks | |
class LogVoiceActivationListener | |
: IVoiceActivationListener | |
{ | |
void VoiceActivationStart() | |
{ | |
Debug.Log("Started Talking"); | |
} | |
void VoiceActivationStop() | |
{ | |
Debug.Log("Stopped Talking"); | |
} | |
} | |
// Somewhere in your code, initialise the listener | |
var listener = new LogVoiceActivationListener(); | |
GetComponent<DissonanceComms>().SubcribeToVoiceActivation(listener); | |
// When you no longer want to receive events | |
GetComponent<DissonanceComms>().UnsubscribeFromVoiceActivation(listener); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment