My code is quite extensive because it contains all sorts of diagnostics and integrations, but the main loop() routine where all the MOVI interaction takes place isn’t too bad. I need to solve my microphone problem before I’d feel confident in sharing the code.
Perhaps I can pose a couple of general scenarios for your comment in the meantime, in case it causes me to change course.
Timeout problem: I find that after the callsign is received, MOVI will wait indefinitely for my voice. Because of the aggressive matching I am experiencing, I wanted to have a 5 second timeout between callsign and sentence recognition. So after receiving the -140 from poll(), if MOVI is still waiting for me to say something, I do movi.stopDialog() followed by movi.restartDialog(). This has so far been successful for me to get MOVI to just go back to listening for the callsign after 5 seconds of hearing nothing. Reasonable?
Utterances preceding callsign problem: I’m actually using a Sparkfun MP3 shield to announce results of diagnostics triggered by MOVI commands. This predates me having MOVI - I was using the other Arduino voice recognition board. MOVI’s voice is reasonably impressive, but the MP3 voices are that much more life like so I’d like to keep things this way. So the first time I say the callsign, MOVI waits up to 5 seconds (my custom timeout) for my first command, then the MP3 announces the results of the requested diagnostic. The second time I give MOVI the callsign, it responds with -140 and then IMMEDIATELY with -141 choosing one of the available sentences, usually a smaller/simpler one. What I did was to do setThreshold(95) before playing an MP3 voice and then setThreshold back to the default after the MP3 is finished playing. This seems to have solved the problem for now (though I’m worried that once I have a mic that I don’t have to “eat” to make work with MOVI that even with a 95 threshold, MOVI may hear the MP3). I tried the stopDialog/restartDialog thing after playing the MP3 as I did for the timeout but it made no difference to the undesired behaviour. Reasonable? Is this expected behaviour that MOVI would cache utterances prior to the callsign and use those in sentence matching?
CALLSIGN_DETECTED not sent problem: A large percentage of the time, poll() doesn’t return CALLSIGN_DETECTED prior to BEGIN_LISTEN. For this one you may need to see my code to comment. For the time being, I’m using BEGIN_LISTEN as an indication that the callsign was detected.
If it helps to get an idea of how my application is intended to work here is a video with the old voice recognition board:
There is no need to watch the whole video, you’ll get the idea after the first 30 seconds or so. I was very lucky with that run by the way, this is not meant to say that I think the other board worked well at all. On the contrary, the other board I speak of is extremely unreliable in my experience. False positives rates were very frustrating. I am hopeful based on what I saw on the “bench” using MOVI’s integrated mic that MOVI can do much better.
Thanks for your advise,
[Last edited Apr 08, 2016 20:49:21]