Closed LeviOS31 closed 1 year ago
Hi, you should only have one instance of the node SpeechToText and reuse it in every scene.
As for your earlier question in the youtube video:
The easiest way to have two different speech-to-text models in the game would be to have two different speech-to-text plugins. To do so clone this repo and change the MODELDIR in src/stt.c and src/stt-linux.c to something like #define MODELDIR "addons/speechtotext2/model"
. Then rename the addons/speechtotext directory to addons/speechtotext2. Recompile the plugin by running make
(or mingw32-make
on Windows) in the src directory.
Then modify addons/speechtotext2/plugin.cfg
, addons/speechtotext2/Plugin.gd
, addons/speechtotext2/speechtotext.gdnlib
, addons/speechtotext2/speechtotext.gdns
, addons/speechtotext2/SpeechToText.gd
to refer to the new plugin naming. Ie.:
Add the new plugin to your game manually (alongside the assetlib plugin):
Then in Godot enable the new plugin:
SpeechToText
node would use one model and SpeechToText2
node could use another model.
Here's an example structure of a project, where pressing SPACE gives voice recognition using one model and pressing TAB gives voice recognition using another:
I hope this solves your use case! Feel free to ask any questions, though.
i have two different scenes that need the text to speech plugin but when i load in the second scene (after coming from the first scene). the second i let go of the speaking button the game freezes and then seems to crash without giving any errors or warnings.