CASP supports multimedia features such as audio recording & playback, voice capture, text to speech and speech to text conversion etc. This example project demonstrates how to generate speech from a given text using CASP on supported targets such as desktop computers and single board computers (Raspberry Pi, Arduino Uno Q etc.).
Pre-Requisites
- Any CASP supported desktop or single board computer.
- A speaker connected to the target and configured as default audio output device in the operating system
- CASP software is installed.
- BSP of the target. If target supporting CASP remote build (such as SBCs) are used, ensure remote build tool chain is installed on the target. For further details refer remote build documentation.
- The project files are located at CASP installed directory ‘CASP/support/examples/multimedia/03_text_to_speech’. These are also available for download at this link.
Connection Diagram
A speaker is required to be connected to the target audio output port and configured as default audio output device in the operating system to run this example.

Procedure

- Start CASP and load the project.
- The project model consists of a text output block where user can enter the text during run time. The output of the text output block is connected to two TTS blocks. The first TTS block ‘tts_default’ is the default block that uses operating system’s TTS engine for TTS output. It works on all supported Windows platforms. However, this block may not work on Linux platforms that do not support native TTS engines. In such cases you may disable this block and use ‘tts_alternate’ block instead. The alternate TTS block is more generic and works with any third party TTS engines which can be invoked from command line interface. For example, to use ‘pico2wav’ TTS engine with CASP ensure ‘pico2wav’ is installed properly. To install this TTS engine, type the following commands in Linux terminal:
- Install ‘pico2wav’ by typing the following command in Linux terminal: sudo apt-get install libttspico-utils
- To test the installation, type the following command in Linux terminal: pico2wave -w lookdave.wav “Hello, Welcome to CASP”
- After installing the software enable and double click the ‘tts_alternate’ block to open block’s configuration and ensure following parameters are set
- Separator Character: #
- Process1 Name: pico2wave
- Process1 Arguments: -w#ttsproc.wav#\”<in>\”
- Process2 Name: aplay
- Process2 Arguments: ttsproc.wav
- Process3 Name: –
- Process3 Arguments: –
- After above parameters are set click the Run button to build and start simulation. In the simulation panel window enter a text in the input text box. You should be able to hear a voice, narrating your input text with output window as shown below.

