Asked
Resolved Resolved by Synthiam Support!

Bing Speech Controlled By A Script

@TMesserschmidt

I tried the script from the tutorial "Add New AIML Categories with Voice." I encountered no errors, but the file created is always empty. To troubleshoot, I wrote a small script:

saywait("start script")
sleep(500)
controlCommand("Bing Speech Recognition", "StartListening")
sleep(4000)
controlCommand("Bing Speech Recognition", "StopListening")
sleep(1000)
print($BingSpeech)
saywait("script end")

This script runs without errors, but the Bing Speech Recognition does not seem to "listen," as the variable $BingSpeech is always empty. When I use the Bing Speech Recognition skill manually, it works perfectly with both "Start Recording" and VAD (Voice Activity Detection). It appears that the "StartListening" command in the script does not communicate with the "Bing Speech Recognition" skill.

I have the same issue with the original script from the tutorial. I have redone the tutorial twice, but the problem persists. Could you please check what might be causing this issue?


Related Hardware EZ-B v4

ARC Pro

Upgrade to ARC Pro

Become a Synthiam ARC Pro subscriber to unleash the power of easy and powerful robot programming

PRO
Canada
#1  

It sounds like you're encountering an issue where the StartListening command in your script isn't properly triggering the Bing Speech Recognition skill. Let's go through a few steps to troubleshoot and ensure everything is set up correctly.

Step-by-Step Troubleshooting

  1. Check ControlCommand Syntax: Ensure that the ControlCommand syntax is correct. The command should be:

    ControlCommand("Bing Speech Recognition", "StartListening");
    
  2. Verify Skill Names: Make sure the name of the Bing Speech Recognition skill in your project matches exactly with what you are using in the ControlCommand. The name is case-sensitive.

  3. Check for Paused State: Ensure that the Bing Speech Recognition skill is not paused. You can unpause it using:

    ControlCommand("Bing Speech Recognition", "UnpauseListening");
    
  4. Test with Simple Script: Create a simple script to test if the StartListening command works:

    ControlCommand("Bing Speech Recognition", "StartListening");
    sleep(5000); // Wait for 5 seconds to allow speech input
    ControlCommand("Bing Speech Recognition", "StopListening");
    print(getVar("$BingSpeech"));
    
  5. Check Microphone Input: Ensure that your microphone is correctly set up and is the default input device. You can check this in the Windows sound settings.

  6. Review Bing Speech Recognition Settings:

    • Ensure that "Auto Record Using VAD" is unchecked if you are manually starting and stopping the listening.
    • Verify that the language and other settings are correctly configured.

Example Script

Here is a refined version of your script with some additional checks:

// Unpause the Bing Speech Recognition if it is paused
ControlCommand("Bing Speech Recognition", "UnpauseListening");

// Start listening
ControlCommand("Bing Speech Recognition", "StartListening");
sleep(4000); // Wait for 4 seconds to allow speech input

// Stop listening
ControlCommand("Bing Speech Recognition", "StopListening");
sleep(1000); // Wait for 1 second to ensure processing

// Print the recognized speech
var recognizedSpeech = getVar("$BingSpeech");
print(recognizedSpeech);

// Provide feedback
Audio.say("Script end");

Additional Debugging

  • Log Output: Add more print() statements to log the progress of your script and ensure each step is executed.
  • Skill Logs: Check the logs of the Bing Speech Recognition skill for any errors or warnings.

Resources

If the issue persists after these steps, please provide more details about any error messages or unexpected behavior you observe. This will help in diagnosing the problem further.


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
PRO
Germany
#2  

@athena, same problem. the variable $bingSpeech is always empty. here is a picture of the output of the script. If i use the skill bing speech recognition  and i start recording, he will display what i am saying, it is ok. If i use the script, he will display the word I have said in the skill bing speech recognition. The start listening command does not trigger the skill bing speech or the command is not understood by the skill bing speech  

User-inserted image

PRO
Canada
#3  

Thank you for providing more details. It seems like the StartListening command is not triggering the Bing Speech Recognition skill as expected. Let's try a few more steps to diagnose and resolve the issue.

Step-by-Step Troubleshooting

  1. Ensure Skill Name Accuracy:

    • Double-check the exact name of the Bing Speech Recognition skill in your project. The name must match exactly in the ControlCommand.
  2. Check for Paused State:

    • Ensure that the Bing Speech Recognition skill is not paused. You can unpause it using:
      ControlCommand("Bing Speech Recognition", "UnpauseListening");
      
  3. Test with Simple Script:

    • Create a simple script to test if the StartListening command works:
      ControlCommand("Bing Speech Recognition", "StartListening");
      sleep(5000); // Wait for 5 seconds to allow speech input
      ControlCommand("Bing Speech Recognition", "StopListening");
      sleep(1000); // Wait for 1 second to ensure processing
      var recognizedSpeech = getVar("$BingSpeech");
      print(recognizedSpeech);
      
  4. Check Microphone Input:

    • Ensure that your microphone is correctly set up and is the default input device. You can check this in the Windows sound settings.
  5. Review Bing Speech Recognition Settings:

    • Ensure that "Auto Record Using VAD" is unchecked if you are manually starting and stopping the listening.
    • Verify that the language and other settings are correctly configured.

Example Script with Debugging

Here is a refined version of your script with additional debugging steps:

// Unpause the Bing Speech Recognition if it is paused
ControlCommand("Bing Speech Recognition", "UnpauseListening");

// Start listening
print("Starting to listen...");
ControlCommand("Bing Speech Recognition", "StartListening");
sleep(4000); // Wait for 4 seconds to allow speech input

// Stop listening
print("Stopping listening...");
ControlCommand("Bing Speech Recognition", "StopListening");
sleep(1000); // Wait for 1 second to ensure processing

// Print the recognized speech
var recognizedSpeech = getVar("$BingSpeech");
print("Recognized Speech: " + recognizedSpeech);

// Provide feedback
Audio.say("Script end");

Additional Debugging Steps

  • Log Output:

    • Add more print() statements to log the progress of your script and ensure each step is executed.
  • Skill Logs:

    • Check the logs of the Bing Speech Recognition skill for any errors or warnings.

Resources

If the Issue Persists

If the issue persists after these steps, please provide more details about any error messages or unexpected behavior you observe. Additionally, you can try the following:

  1. Reinstall the Skill:

    • Remove the Bing Speech Recognition skill from your project and add it again.
  2. Update ARC:

    • Ensure you are using the latest version of ARC. Sometimes updates include bug fixes that might resolve your issue.
  3. Contact Support:

    • If none of the above steps work, consider reaching out to Synthiam support for further assistance.

Please let me know if you need any more help!


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
PRO
Germany
#4  

@synthiam.support it still doesnot work with the script. I restarted ac,pc and i loaded a minimal configuration to start with a good basis. 2 skills are loaded, aimlbot and bing speech recognition. it works fine. i can talk to bing and i got a response. below is the config of bing, aimlbot has no script.  i made a script with the infos povided by athena but can not get it worked. the variable $BingSpeech is empty.. If I use the bing speech recognition by doing start recording or using VAD  this variable is set. heres the script provided from athena.

Here is a refined version of your script with additional debugging steps:

// Unpause the Bing Speech Recognition if it is paused ControlCommand("Bing Speech Recognition", "UnpauseListening");

// Start listening print("Starting to listen..."); ControlCommand("Bing Speech Recognition", "StartListening"); sleep(4000); // Wait for 4 seconds to allow speech input

// Stop listening print("Stopping listening..."); ControlCommand("Bing Speech Recognition", "StopListening"); sleep(1000); // Wait for 1 second to ensure processing

// Print the recognized speech var recognizedSpeech = getVar("$BingSpeech"); print("Recognized Speech: " + recognizedSpeech);

// Provide feedback Audio.say("Script end");

setting of skill big speech recognition

User-inserted image

User-inserted image

PRO
Synthiam
#5   — Edited

You’re using different variables for different stuff. In your screenshot the variables are different. And it’s using SetPhrase and such - and ControlCommand() for start listening doesn’t wait.

im not fully sure what it is you’re trying to do. Can you explain it? That’ll help

@athena explain how the ControlCommand doesn’t wait and results of a async command such as startlistening should have code in the all recognized script of Bing. It’s documented in the manual as well.

but we can move forward if you can explain what your outcome is. Because I can’t quite make it out by the code or questions to Athena at this time.

PRO
Canada
#6  

Thank you for the additional context and for pointing out the asynchronous nature of the ControlCommand().Lets clarify how to handle asynchronous commands and ensure that the recognized speech is processed correctly.

Understanding Asynchronous Commands

The ControlCommand() for StartListening does not wait for the speech recognition to complete. Instead, it triggers the listening process, and the result is handled asynchronously. This means that the script will continue executing without waiting for the speech recognition to finish.

Handling Asynchronous Speech Recognition

To handle the recognized speech, you should use the "All Recognized" script within the Bing Speech Recognition skill. This script will be executed when the speech recognition process completes and the speech is recognized.

Steps to Implement

  1. Configure the "All Recognized" Script:

    • Open the Bing Speech Recognition skill.
    • Go to the configuration settings.
    • Find the "All Recognized" script section.
    • Add the script that processes the recognized speech.
  2. Example "All Recognized" Script:

    // This script will be executed when speech is recognized
    var recognizedSpeech = getVar("$BingSpeech");
    print("Recognized Speech: " + recognizedSpeech);
    Audio.say("You said: " + recognizedSpeech);
    
  3. Triggering Speech Recognition:

    • Use a separate script to start and stop the listening process.
    • The recognized speech will be handled by the "All Recognized" script.

Example Script to Trigger Listening

// Unpause the Bing Speech Recognition if it is paused
ControlCommand("Bing Speech Recognition", "UnpauseListening");

// Start listening
print("Starting to listen.");
ControlCommand("Bing Speech Recognition", "StartListening");

// Wait for a few seconds to allow speech input
sleep(4000);

// Stop listening
print("Stopping listening.");
ControlCommand("Bing Speech Recognition", "StopListening");

// The recognized speech will be handled by the 'All Recognized' script

Summary

  • The ControlCommand("StartListening") does not wait for the speech recognition to complete.
  • Use the "All Recognized" script within the Bing Speech Recognition skill to handle the recognized speech.
  • Trigger the listening process using a separate script, and let the "All Recognized" script process the result.

Additional Resources

Please let me know if you need further assistance or if you have any specific requirements for your project!


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
PRO
Synthiam
#7  

@athena, you don’t have to send the stoplistening command because the listening will expire after it receives silence or times out. So you only need to trigger the start listening, and the response is processed in the All Recognized script

PRO
Canada
#8  

Thank you for the clarification, DJ Sures. Let's simplify the process based on your input.

Simplified Approach

  1. Configure the All Recognized Script:

    • Open the Bing Speech Recognition skill.
    • Go to the configuration settings.
    • Find the All Recognized script section.
    • Add the script that processes the recognized speech.
  2. Example All Recognized Script:

    // This script will be executed when speech is recognized
    var recognizedSpeech = getVar("$BingSpeech");
    print("Recognized Speech: " + recognizedSpeech);
    Audio.say("You said: " + recognizedSpeech);
    
  3. Triggering Speech Recognition:

    • Use a separate script to start the listening process.
    • The recognized speech will be handled by the All Recognized script.

Example Script to Trigger Listening

// Unpause the Bing Speech Recognition if it is paused
ControlCommand("Bing Speech Recognition", "UnpauseListening");

// Start listening
print("Starting to listen.");
ControlCommand("Bing Speech Recognition", "StartListening");

// No need to send StopListening; it will automatically stop after receiving silence or timing out

Summary

  • Trigger the listening process using the StartListening command.
  • Handle the recognized speech in the All Recognized script.
  • No need to send the StopListening command; it will automatically stop after receiving silence or timing out.

Additional Resources

Please let me know if you need further assistance or if you have any specific requirements for your project!


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
PRO
Germany
#9  

@DJ_Sures you wrote " im not fully sure what it is you’re trying to do. Can you explain it? That’ll help" Originally ,I just wanted to use the program from the tutorial "add new aiml categories with your voice". As it did not work, i narrowed down the problem and it came out that the start listening into my script never triggered the bing speech recognition skill. The skill bing speech recognition itself works well either with manually start recording or using VAD. i attached pictures of my screen and the scripts provided by athena.  I expect that when i clic on start in my script and i speak ,the bing speech recognition recognizes the phrase,words and then i could use the program in the tutorial:) my screen>

User-inserted image

User-inserted image

User-inserted image

User-inserted image

#10  

Uncheck play wake sound and try again. That feature was introduced and may have an issue with controlcommand

User-inserted image

PRO
Germany
#11  

yes it is ok. it works now. So I think we should always uncheck this feature. thanks

#12  

Looks like they fixed this issue in the latest update that was just released today. Thanks you!

I ran across this issue months ago and didn't report it. Sorry. I thought is was something I was doing wrong. Bad sound file or something.

PRO
Germany
#13   — Edited

I just downloaded the last update .I still have other issues with the script even after removing "stop listening".Possibly timing problem. not sure.  i can get  a new file with only the text, no aiml format and the test is truncated. So far I understand, you got a new file,text file and you have to insert the text into a formatted aiml file,it is not easy. Maybe i expected too much from the aiml script. I thought i get a new aiml formatted file that i could add into the aiml folder. So i gave up as it i was not really critical.