Speech to Text with CASP

This example project demonstrates how to generate text from human speech using CASP.

 

Target

Native target is used for this project. However, any supported computer including single board computers (SBC) such as Raspberry Pi, Arduino Uno Q etc. can be used.

 

Description

A microphone is required to be connected to the target computer and configured as default audio input device in the operating system. The model consists of an audio recorder block connected to a push button switch at its input port to trigger recording and subsequently speech to text conversion process. The output of the audio recorder is connected to speech to text block that generates text output from recorded speech. The output text is displayed through ‘out_text’ block.

 

The speech to text block in the model requires ‘whisper.cpp’ program to be installed and functioning. It can be downloaded and installed from whisper.cpp developer webpage: https://github.com/ggml-org/whisper.cpp. Required instructions to download and install the program and its dependencies are mentioned in this webpage.

 

Alternatively, CASP tested version of the 'whisper.cpp' program is readily available to download at our address: https://aadhuniklabs.com/casp/third_party/multimedia/whisper.cpp_casp.zip. Just download and extract the zip file to your preferred location (preferably to this project’s directory). Within the whisper.cpp folder extract the binary directory based on your platform (whisper-bin-x64.zip for Windows, whisper-bin-ubuntu-x64.tar.gz for x64 Linux platforms and whisper-bin-ubuntu-arm64.tar.gz for ARM64 Linux platforms such as Raspberry Pi, Arduino Uno Q etc.). Please read the ‘readme.txt’ file from whisper.cpp folder for details on how to install and run the program.

 

After whisper.cpp is properly installed and functioning, run CASP and load the project. Configure ‘speech_to_text’ block parameters. Please refer block’s help on how to specify parameters related to whisper.cpp executable, model and audio file paths. After the parameters are set click the Run button to build and start simulation.

Model

Output

Output simulation panel window is shown below. In the simulation panel window click and hold push button ‘pb0’, speak a sentence and release the push button. After some seconds you should be able to see your narrated text in the ‘out_text’ window.

 

References

Please go through our video tutorials, tutorial projects and CASP main documentation for getting started with CASP.