Skip to content

Instantly share code, notes, and snippets.

@martindevans
Created September 17, 2020 15:57
Show Gist options
  • Save martindevans/e8541d6b50f750446e4d5500ae32d884 to your computer and use it in GitHub Desktop.
Save martindevans/e8541d6b50f750446e4d5500ae32d884 to your computer and use it in GitHub Desktop.
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