This is a plugin that exposes the Azure Speech to Text capability to the VisRen Lua environment so scripts in a scene can perform speech to text operations and receive the spoken text as a string.
Blog posts related to this plugin can be found here and here
Visual Studio 2019 recommended.
- Clone this repository (or download the zip)
- Open the AzureSpeechToText solution
- Edit Exports.cs as follows:
- Replace the placeholder values for the Azure subscription keys
var config = SpeechConfig.FromSubscription("YOUR_SUBSCRIPTION_KEY", "YOUR_SUBSCRIPTION_REGION");
- Replace the placeholder VisRen native SDK key with a valid license
return "YOUR_VISREN_NATIVE_API_KEY";
- Build the project
- Copy the bin/Release (or bin/Debug if you build debug mode) folder to Documents/VisionaryRender/plugins and rename it to "AzureSpeechToText". (if your VisRen plugins folder is elsewhere, adapt as necessary)
- Create a
plugin.txt
file in the AzureSpeechToText directory, and inside it enterAzureSpeechToText.dll
- Press F6 (or File -> Windows -> Settings)
- Select the "Plugins" category
- Ensure the "AzureSpeechToText" plugin row is present and its status says "Loaded"
To start listening and receive spoken input as text, you need to register an "onSpeech" callback. You can do this in the script Console, or in a Create script or somewhere that will only execute once
__registerCallback("onSpeech", function(text)
print("Spoken: ", text)
end)
Now that the callback is registered, you can freely call the following functions from any other script (e.g. button press, gui click, etc):
To start listening
AzureSpeechToText.StartListening()
To stop listening
AzureSpeechToText.StopListening()
If you want notification of other events you can also subscribe to the following events using the same __registerCallback
method as above:
onSpeechSessionStarted
onSpeechSessionStopped
onSpeechStartDetected
onSpeechEndDetected
MIT