Question · Speech recognition
How do you add speech recognition to a Unity or Unreal game?
Unity has a built-in dictation class, DictationRecognizer, but it works only on Windows 10 and only when the user allows dictation. For Unreal Engine 5 and Godot, our searches found no built-in recognizer, so you add a third-party plugin and check its license and platforms before you ship.
Updated October 17, 20263 min read4 cited facts, each traced to its source
Unity and Unreal take different routes. Unity ships a dictation class, but it is limited to Windows. Our searches for Unreal and Godot did not turn up a built-in recognizer, so a game on either engine usually adds a plugin. The right choice depends on the platforms you ship to and on whether the recognition must run on the player's device.
Unity's built-in dictation runs only on Windows 10
Unity's scripting reference covers DictationRecognizer, the class for dictation in Unity. It says the recognizer is currently functional only on Windows 10 1. If dictation is not enabled for the user, DictationRecognizer fails on Start 2, so a game has to handle that case rather than wait for speech that never arrives.
A Unity build for Mac, Linux, Android, iOS or WebGL cannot use this class. For those targets you need a different recognizer. Our guide to on-device and cloud recognition explains the trade-off between a model that runs locally and a server.
Dispose the recognizer when you finish
Unity's reference says that once you are done with the recognizer, it must be disposed using the Dispose() method, to release the resources it uses 3. In a game, call Dispose() when the scene that uses dictation closes, and do not leave the recognizer running in the background.
Unreal and Godot need a plugin, not a built-in recognizer
Our web searches for a built-in speech recognizer in Unreal Engine 5 and in Godot found none. Treat that as a search result rather than a guarantee, and check the current engine documentation before you start. If you look for an Unreal plugin, read its license and supported platforms yourself before you use it.
For Godot, the addon Godot Whisper is listed in the Godot Asset Library. The listing describes it as an addon that enables realtime audio transcription and supports OpenCL on most platforms and Metal on Apple devices 4. "Most platforms" is not "all platforms," so check each target you ship to, including Android.
It depends: offline models, streaming and licenses
A plugin that runs a model on the device keeps audio off a server, but the model uses the player's CPU or GPU during play. A cloud service avoids that cost, but it needs a connection and an account with the provider. Choose by which cost your game can carry.
If the game needs words to appear while the player is still speaking, you need streaming recognition. Our guide to real-time speech recognition covers latency and why streaming matters. Licenses differ from plugin to plugin, so read each one before you ship.
What to do
- List your platforms first. If the game ships only on Windows 10, DictationRecognizer is an option.
- For Windows-only Unity, handle the permission path. Check that dictation is enabled, and show a message when it is not.
- Dispose the recognizer when you finish, and release it when its scene closes.
- For other platforms or engines, pick a plugin that supports each target and test it on the hardware you ship to.
- Read each plugin's license and platform list before you ship.
A Unity WebGL build runs in a browser, not on Windows, so the built-in class does not apply there. For that case, the speech recognition question for JavaScript covers the Web Speech API, and the network error question covers its errors. For phone builds, read how to add speech recognition to React Native. The Windows interfaces behind this area are described in the glossary entry for the Windows Speech API. This question sits inside our guide to speech recognition in Python and the speech recognition overview.
Evidence
Every number on this page, with where it comes from. Open a fact to see the exact words in its source.
- 1.
- 2.
- 3.
- 4.
Go deeper
Related questions
- How do you add speech recognition to a React or React Native app?
- Why does speech recognition show a network or not-allowed error?
- Can an ESP32 or microcontroller do speech recognition?
- Can large language models do speech recognition?
- Can Whisper AI do text to speech?
- Can Whisper identify different speakers?
- Can Whisper run without a GPU?
- Can Whisper transcribe in real time?