This repository contains a standalone version of the Tube Resonance Model (TRM) used in the Gnuspeech articulatory speech synthesizer. The code comes with a thin C wrapper that allows to control all aspects of the TRM in realtime. Furthermore, a Python wrapper is included that enables integration of TRM into any Python application.
Building the code was tested on Linux only. You'll need a C++11 compatible compiler. The code has no dependencies apart from the C++ standard library.
To compile the library, simply run
git clone https://github.com/astoeckel/gnuspeech_trm
cd gnuspeech_trm
make
In case the Makefile does not work for you, you can compile the executable by running
c++ -O3 -s gnuspeech_trm/*.cpp gnuspeech_trm/trm/*.cpp -o build/gnuspeech_trm_main
and the library by running
c++ -O3 -s -fPIC -shared gnuspeech_trm/trm/*.cpp -o build/libgnuspeech_trm.so
To test the code, run
build/gnuspeech_trm_main | aplay -f FLOAT_LE -c 1 -r 44100
To install the corresponding Python wrapper, run
pip3 install --user -e .
Test it by running
gnuspeech_trm/gnuspeech_trm.py | aplay -f FLOAT_LE -c 1 -r 44100
Please have a look at the code at the end of gnuspeech_trm/gnuspeech_trm.py
for the Python wrapper and at gnuspeech_trm/gnuspeech_trm_main.cpp
for
the for the C wrapper. More details can as well be found in the C header
gnuspeech_trm/gnuspeech_trm_main.h
.
The code in the trm
subfolder is licensed under the GPLv3 by various authors.
The C and Python wrappers are (C) 2018 Andreas Stöckel, licensed under the GPLv3.