Jampal mp3 Library
Peter's Text to Speech


Summary of Features
Detailed Features
What's New?
Download
Installation & Getting Started
License & acknowledgements
Project Info

User's Guide
Library Window
Playlist Window
Track Editor Window
Customization
Advanced Topics
Regular Expressions
Trouble Shooting
Tables

Utilities
mp3 Management Scripts
Tag Backup
Tag Update
Text to Speech
Speech XML Format
Speech Phonemes

Author
Peter Bennett

My Other Projects
Peter's Backup

SourceForge.net Logo
Simple text to speech command line program

This is a very simple Microsoft Windows command line program to convert text to speech. If uses the Microsoft Text to Speech Engine and the Microsoft Speech SDK. THe Text to Speech Engine is installed with Windows XP with one voice of somewhat poor quality. The Jampal installation program includes two better sounding voices.

The text can be keyed in or read from a text file. The sound can be output to the computer sound system or sent to a wave file. Text is read from standard input or can be read from a file using a redirect, for example, to read aloud a text file:
ptts < war-and-peace.txt

To create a wav file from the text file (e.g create an audio book ;) ):
ptts -w war-and-peace.wav < war-and-peace.txt

Adjust the speech and voice defaults using the speech control panel option. Customization of the speech can also be performed using XML. For details see Speech XML Format and Speech Phonemes. If XML is included, there must be an XML tag as the first character of the text. If you don't need any XML at the start of the text, include <> at the beginning.

There is a lexicon associated with each user in Windows. This is used by Jampal as well as ptts. You can update the lexicon to correct the speech engine pronounciation of certain words. The -la option (see below) updates the lexicon for jampal as well as ptts. For example the speech engine does not know how to pronounce Qntal, so it says "Bleah" when it sees Qntal in the input. The following command corrects it. For details of the phonemes in quotes, see Speech Phonemes.

ptts -la Qntal "k w ih n t ao 1 l"

Usage

Typing the ptts command with -h will list out the available options.

Usage: ptts [options]
OptionExplanation
-w filename Create a wave file instead of outputting sound. Wave file will be CD quality, 44100 samples per second, 16 bit, stereo unless changed by a -s or -c option.
-m filename Create multiple wave files, a new wave file after each empty input line. This appends nnnnn.wav to the filename.
-r rate Speech rate -10 to +10, default is 0.
-v volume Volume as a percentage, default is 100.
-s samples Samples per sec for wav file, default is 44100.
-c channels Channels (1 or 2) for wav file, default is 2.
-u filename Read unicode text from file instead from stdin. Note this must be a binary Microsoft style Unicode file, not a text file. To read a text file use redirection (< filename).
-voice xxxx Voice to be used.
-vl List voices.
-la word "pronounciation" Add word to lexicon.
-la word "" Delete word from lexicon.