Rants of a madman » Text to speech - Command line save to wav - Whats missing in TextAloud
Jul
16

Presenting “sapi2wav”. (name choosen because text2wav was already taken)

Its a simple windows tool that allows you to do Text-To-Speech on command line.

The program will play a text given as argument or read a file and output to a wave file. It also allows you to choose other voices, if eg. you have NeoSpeech voices or AT&T Natural voices.

Its free (unlike any other commandline SAPI program ive found) and its Open Source (GPL).

Commandline processing is a MUST for any form of scripting or automation. I wanted to automaticly transfer daily news-stories to and MP3 player and now i can :)
Usage is as simple as:

sapi2wav.exe c:\out.wav 1 -t “Hello world”

TextAloud has a commandline mode, but its very oddly written, pretty beta and doesnt run under Linux. I wrote to Text Aloud (or NextUp.com) explaining my very insignificant problem and of course they didnt reply. So instead of buying their product, i ended up making an open source alternative :).

So if you install SAPI5 under wine (must be installed in windows ME compatability mode), then you can run this tool under wine as well and do commandline magic :)

Downloads:

Setting up MS-SAPI5 under wine should be as easy as configuring your wine to run in Windows ME mode, then download and run MS’s Sapi5 installer (msi - the Win ME version)

Winehq has an article on how to do this.

The tool SayPad from this page should have sapi5 included in the 95/98/me installer.. Though i havent testet it, i guess if you can install SayPad under wine, youll get the needed api’s.

please send me any changes you might make to this sapi to wav tool.



  - Dan

Comments

  1. Markus Said,

    this sir, is exactly what I’m after…. cheers for that

  2. copycat Said,

    do you have, or know of, a version for sapi4? i like those voices better, and have a specific application for which sapi4 is more suitable. please shoot me an email, even if the answer is no, so i ‘ll know. thanks,
    –copycat

  3. Dan Said,

    It shouldnt make a difference whether you have SAPI4 or 5 installed. Although i havent tested SAPI4 myself, i dont see why this tool shouldnt work with it.
    Give it a try and let me know the result :)

  4. David Eaton Said,

    Dan,

    Any way to change the default output settings? I was looking for:
    128kps
    16 bit
    1 channel (Mono)
    8 kHz sample rate
    PCM

    Keep in touch, David

  5. Dan Said,

    Sorry for the late reply.
    Currently there is no way to change the output setting without changing inside the source code.
    I may add options for these at some point, but i don’t have time currently.
    So either you must change the sourcecode or convert wave-file manually using another tool.

  6. Nuno Baptista Said,

    Hello,
    i’ve been using this software for quite some time. Thanks a lot.
    I was now wondering if it would be possible to make it work directly to standard output, in order to be able to redirect it to a named pipe, so that one could execute it faster.

    Thanks alot.
    Best Regards

Add A Comment

REFRESH THIS PAGE TO POST COMMENTS!