Skip to content

Drsorab/HearthSpeech

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Speech Recognition in Unity

Speech (Voice) Recognition using C# and Unity3D.

Speech recognition game in Unity3D

Prerequisites

To run the project, you’ll need the following software components:

  • Unity3D 5.5+
  • Visual Studio 2015+
  • Windows 10

Source Code

We'll be using the KeywordRecognizer class to detect the voice commands:

private KeywordRecognizer recognizer;

private void Start()
{
    if (keywords != null)
    {
        recognizer = new KeywordRecognizer(keywords, confidence);
        recognizer.OnPhraseRecognized += Recognizer_OnPhraseRecognized;
        recognizer.Start();
    }
}

private void OnApplicationQuit()
{
    if (recognizer != null && recognizer.IsRunning)
    {
        recognizer.Stop();
    }
}

private void Recognizer_OnPhraseRecognized(PhraseRecognizedEventArgs args)
{
    word = args.text;
    results.text = "You said: <b>" + word + "</b>";
}

Exporting the project

KeywordRecognizer is available for Windows Standalone and Windows Store (Windows 8.1 or Windows 10):

  • PC
  • Phone
  • XBOX
  • HoloLens

Contributors

The project is brought to you by LightBuzz

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published