Closed Treshank closed 3 years ago
I haven't tested this myself to verify it, but I think your problem may be that you are importing and building the grammars before you have initially called get_engine
. What if you move the import line to be after that? By the way, you don't actually need to load and unload your grammars for the wake/sleep: that grammar is specially marked as exclusive, so it should automatically effectively disable all other grammars (that are not also marked as exclusive) whenever it is asleep.
I haven't tested this myself to verify it, but I think your problem may be that you are importing and building the grammars before you have initially called
get_engine
. What if you move the import line to be after that? By the way, you don't actually need to load and unload your grammars for the wake/sleep: that grammar is specially marked as exclusive, so it should automatically effectively disable all other grammars (that are not also marked as exclusive) whenever it is asleep.
Seems to have solved the problem. I shall test it a little more and close the issue
Thanks @daanzu Solved the problem
Hmm. I realise this has been solved, but perhaps the get_engine()
function should be adjusted. I think the Kaldi engine should be preferred over Sphinx and SAPI 5, if it is available.
@daanzu What do you think?
@Danesprite I think that makes sense and would be a good change. Also, I wonder if there should be a conspicuous warning message or something when this happens, where get_engine is called automatically because a grammar is loaded or whatever? This has definitely occurred other times, and been a bit confusing.
Okay then, I'll open a PR for it. An info message also sounds like a good idea to me. I'll change get_engine()
to log a message when an SR engine is decided on and returned by the function. The message should only appear once when the engine is initialised.
I'm not sure if this is an issue or I'm making a mistake somewhere, but every time I seem to import Grammar in a file and create functions to load them in the
main.py
, the engine changes Kaldi to sapi5 and I also get this error that Natlink requires 32bit python. Then no speech is detected at all. However if I create, add and load the grammars directly inmain.py
it works.main.py is the same as
kaldi_module_loader_plus.py
except for the importing loadL1 and unloadL1 and using them when the system is awake and sleepingI also found this issue occurring when I use
Integer
orIntegerRef
.