Coder Social home page Coder Social logo

sevangelatos / picopi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from douggore/picopi

0.0 1.0 1.0 17.02 MB

Port of Android Pico TTS to the Raspberry Pi

Makefile 0.44% C++ 4.61% C 90.59% Java 1.75% Shell 0.95% Perl 1.11% Lua 0.54% CMake 0.02%

picopi's Introduction

Pico TTS for Raspberry Pi

This is a port of the offline text-to-speech engine from Google's Android operating system to the Raspberry Pi. Pico TTS is specifically designed for embedded devices making it ideal for memory and processing constrained platforms like the Raspberry Pi. The original code was licensed under the Apache 2 license and this derivative keeps that license.

This port is a little rough around the edges due to it being a fairly quick and dirty port and my lack of skills in makefile voodoo. I have tried to remove the Android specific files and put the minimal code from the rest of the Android ecosystem. I have left the JNI code in the repository untouched in case anyone fancies getting the Java integration working.

The structure of the respository is as follows:

  1. pico_resources/docs/ - Pico TTS documentation A very comprehensive set of documents from the original Pico TTS vendor SVOX.

  2. pico_resources/tools/ - Pico TTS tools Some of the tools used to build the TTS data. I have no idea whether they are useful or not.

  3. pico/lib - The Pico TTS engine itself This this original Pico TTS engine source code. It is very portable and didn't require any changes to get compiling. The makefile will build libsvoxpico.so which can be used directly using the documentation mentioned above.

  4. pico/tts - High level C interface and test application

Building the library and testing it

To build the low level TTS library use the following commands:

cd pico/lib make && sudo make install

This will build the library and put the resulting libsvoxpico.so into the /usr/lib/ folder so it can easily be incorporated into any application.

To build the test application

After completing the above commands now put in the following:

cd ../tts make

You will get an executable file called "ttstest". This application takes a string as input and will output the raw audio to stdout or to a file using the -o command

Usage: testtts <-o filename.raw> "String to say here"

Options: -o Optional command to output data to a file rather than stdout

Please note the TTS engine outputs audio in the following format: 16000 Hz, 16-bit mono (little endian).

As the test program outputs to stdout you can feed the raw audio data straight into ALSA's aplay tool to hear the audio on the HDMI or 3.5mm analogue output. Here is an example of how you can do this including the appropriate configuration parameters for aplay:

./testtts "This is a test of the Pico TTS engine on the Raspberry Pi" | aplay --rate=16000 --channels=1 --format=S16_LE

I hope you find this port useful for building your Raspberry Pi based applications. Please feel free to adapt the project to your needs. If you do use this work in your project I would love to hear about it, please drop me a tweet. Thanks.

  • Doug (@DougGore)

picopi's People

Contributors

douggore avatar ktsakalozos avatar sevangelatos avatar

Watchers

 avatar

Forkers

realitycheck

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.