How to add Google Speech to Text in Unity 2019

This is a very straightforward tutorial 😀

Image for post
Image for post
Your game may not be a robot, but after this it will understand exactly what you say! Photo by Morning Brew on Unsplash

There is little available on the Internet regarding API integrations in small game projects. Indie games are pushing the envelope every day, changing the paradigm of gaming. It’s only a matter of time before your next game project requires some form of data ingress/egress via API.

Take a standard visual novel. They are a dime-a-dozen, however! An interactive short story where the player voices their own intent to progres the game? That is truly unique. Voice input as a mechanic, be it for communication, navigation, interacting with the game world, is a fairly unexplored method of control.

This tutorial hopes to provide you with the steps to get a very basic Speech to Text game set up, using Google’s open APIs.

Image for post
Image for post
I was discussing a sports related injury. Looks like they got it!

Then add the OnInterim and OnFinalResult functions to your StreamingRecognizer, and you are done! Congratulations, you are now capturing voice input that you can use in your game.

Image for post
Image for post
Some great one-liners for your next “Choose Your Own Adventure” game!

What kind of amazing games are you excited to make with this functionality? Let me know in the comments, and happy coding!

Freelance game designer / developer. Full stack developer. Board game geek and cat tamer.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store