MATLAB Command Line
Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:
quarc_host_speech_synthesis_event_driven_demoQUARC Host Speech Synthesis Event-Driven Demo
This example demonstrates how to use the Host Speech Synthesis block from the QUARC Targets library to generate speech in response to an event. It also shows how to extract the current sentence and word being spoken. For details of this block, please refer to the Host Speech Synthesis block reference page in the QUARC documentation.
In addition to the Host Speech Synthesis block, we have included the String Select and String Subset blocks from the QUARC Targets library in this model. These blocks are useful for manipulating strings within the Simulink environment.
Demonstration
Select 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 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.
from the menu of the diagram, or pressDouble-click on the Start and Done Scopes to open them in a separate window.
Click on the
button or select from the menu of the diagram to connect to the model.Start the model by clicking on the
button or selecting from the menu of the diagram. The item of the menu may also be used to both connect and start the model in one operation.The model will tell you the position of the Manual Switch in the diagram. Double-click on the Manual Switch to have it tell you the new position of the Manual Switch as well as the simulation time at which the switch was changed.
Notice that the speech is triggered by rising edge of the "switch changed" signal, which appears as a pulse on the Start Scope. When the speech has completed, the "done" signal is asserted for one sampling instant, as shown in the Done Scope.
Also, while the text is being spoken, the "Sentence being spoken" and "Word being spoken" String Displays show the sentence and word currently being spoken respectively. These displays illustrate how the Host Speech Synthesis block can notify the model of events related to the speech. These events can be used for everything from simple displays to full blown facial animations and robotics.
Click on the
button or select from the menu of the diagram to stop the model. The item of the 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.
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.