quarc_host_speech_recognition_voice_commands_demo.mdl
Open this model

MATLAB Command Line

Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:

quarc_host_speech_recognition_voice_commands_demo

QUARC Host Speech Recognition Voice Commands Demo

This example demonstrates how to respond to simple voice commands using the Host Speech Recognition block from the QUARC Targets library. For details of the Host Speech Recognition block, please refer to the Host Speech Recognition block reference page in the QUARC documentation.

Host Speech Recognition Voice Commands Demo Simulink Diagram

Demonstration

Before running the demonstration for the first time, be sure to configure speech recognition on your computer. Use the Speech Recognition Control Panel applet in Windows to configure the default Microsoft Speech Recognition engine. It may be found under the "Ease of Access" category in Control Panel. A microphone designed for speech recognition should be used to get optimal results. Using a USB headset is generally preferable to using a sound card in the PC.

Select Build from the QUARC menu of the diagram, or press Ctrl+B while the diagram is the active window. A great deal of output will appear in the Diagnostic Viewer about the progress of the build. If you cannot see the Diagnostic Viewer, you can open it by selecting View/Diagnostic Viewer from the menu of the diagram, or clicking on the View Diagnostics hyperlink at the bottom of the diagram. If you have MATLAB R2013b or earlier then the output will appear in the MATLAB Command Window.

Double-click on the New and Command Scopes to open them in a separate window.

Click on the Connect to Target button or select Connect to Target from the Simulation menu of the diagram to connect to the model.

Start the model by clicking on the Run button or selecting Run from the Simulation menu of the diagram. The Start item of the QUARC menu may also be used to both connect and start the model in one operation.

The model will begin responding to voice commands. The commands it recognizes are:

Note that the Minimum Confidence parameter of the Host Speech Recognition block may need to be adjusted to obtain optimal recognition results. For the default Microsoft Speech Recognition Engine included with Windows 7 and above, the confidence level may range from 0 to 1. Higher values cause the speech engine to be more stringent in its assessment of a recognition, leading to fewer false recognitions. However, if the value is too high then it might not recognize the speech at all. This value is speech engine dependent, so it is safest to start with a value of zero and increase it if an improvement in speech recognition accuracy is required. If the default Microsoft Speech Engine is being used a value of 0.90 to 0.94 typically produces reasonable recognition accuracy.

When a voice command is recognized, the "new" output will go high for one sampling instant and the "cmd" port of the Host Speech Recognition block will output the index of the spoken command in its list.

New Scope Command Scope

To make it easier to see which command the Host Speech Recognition block has recognized, a String Select block is used to convert the command identifier back to a human-readable string. The string is printed in the "Spoken command" String Display block.

Spoken command

Click on the Stop button or select Stop from the Simulation menu of the diagram to stop the model. The Stop item of the QUARC menu may also be used.

Running the example on a different target

To run the example on a different target, refer to the instructions on the Running QUARC Examples on Remote Targets page.