quarc_host_speech_synthesis_state_driven_demo.mdl
Open this model

QUARC Host Speech Synthesis State-Driven Demo

This example demonstrates how to use the Host Speech Synthesis block from the QUARC Targets library to generate speech in response to state changes of a state machine. For details of this block, please refer to the Host Speech Synthesis block reference page in the QUARC documentation.

Host Speech Synthesis State-Driven Demo Simulink Diagram

In addition to the Host Speech Synthesis block, we have included the String Select block from the QUARC Targets library in this model. This block is useful for getting the name of the current state as a string.

Demonstration

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 State Number and Done 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 tell you the current state.

Notice that the speech is triggered by the name of the state changing. There is no need to have a separate "start" signal to trigger the speech. When the speech has completed, the "done" signal is asserted for one sampling instant, as shown in the Done Scope.

Done Scope

Also, the "Text to speak" String Display show the text currently being spoken.

Text being spoken

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.