The Lexicon Runtime is a MonoBehaviour that adds Lexicon functionality to a scene. So far, all of our entities, intents, and workspaces exist as assets. These are not bound to any particular scene. The Lexicon Runtime takes a single workspace and manages its runtime. It is responsible for the following:
- Connecting to the Watson Speech to Text and Assistant services
- Starting and stoping the microphone service
- Receiving results from Speech to Text and forwarding them to Assistant
- Parsing results from both services and merging them
- Assigning locally aligned timestamps to all relevant data
- Figuring out which intents were satisfied and calling their Process methods
- Calling global handlers for Speech to Text results, Keyword results, and Assistant results
To get all this functionality, simply add the LexiconRuntime component to any GameObject in your scene. Assign the workspace, and you’re ready to go!
You will probably also want to add a Focus Manager, more on that later.
A scene can have multiple Lexicon Runtimes, but only one can be active at a time.