Swift from Cepstral
Swift can be used to create audio files from text (Text to speech). It’s fairly fast and can easily be called from an AGI for on-the-fly text to speech (such as a weather report) or can be used to create static files while an application is in development.
To synthesize text from the command line:
swift -o /tmp/greeting.wav -p audio/channels=1,audio/sampling-rate=8000 “Welcome to asterisk.”
To synthesize text from a text file
swift -p audio/channels=1,audio/sampling-rate=8000 -o /tmp/weather.wav -f /tmp/weather.txt
Installation Notes
After installing Cepstral a few things need to be updated in most situations to allow Asterisk cmd swift to use it.
The path
into /etc/ld.so.conf or /etc/ld.so.conf.d/local.conf (depending on your linux distribution) and then run
If you recently purchased a copy of swift from Cepstral, you may have a version which has some issues. See Changelog below.
Swift CHANGES
4.0.1 – January 31, 2006
New Features:
- ‘swift -t’ shows each sentence at the time it is played. This is very
handy for listening to text and seeing what it is saying as it says it.
- New additional parameters to ‘swift –register’ and ‘swift –reg-ports’
to allow you to enter your voice or concurrency license information
with a single command using arguments. Run ‘swift –help’ for more
information and examples.
- ‘swift –say-pgm-version’ speaks version information.
- ‘swift –say-voice-version’ speaks name, language, and version of
currently loaded voice. This can be used in conjunction with -n switch
to set voice.
- ‘swift –say-all-voices’ lists and speaks names, languages, and
versions of all voices found on the system
- Multiple text arguments are concatenated and spoken as one utterance.
This causes the following two commands to be treated identically:
swift -n David “Hello, how are you?”
swift -n David Hello, how are you?
Whereas before, the latter command would make four seperate calls to
synthesize each word seperately.
Enhancements:
- ‘swift –help’ now shows a much more readable help message, and
inclues several usage examples.
- When synthesizing text from standard input by using ‘swift -f -‘, you
can now signal a chunk of text to be synthesized by passing two consec-
utive newline characters.
- Improved output messages for errors, warnings, and other engine output
Bug Fixes:
- FIXED: Input text starting with a hyphen is treated as a parameter
switch. For instance, something like “$swift ‘–The Raven–…'” will
print out the Usage string, as if you’ve entered an invalid switch.
NOTE: To signify the end of options, use “–” by itself. For instance:
./swift -n William –events — “–The Raven” -o hello.wav
Will speak, “The Raven, Oh Hello dot wav” in Williams voice and
will *not* create a wave file (the -o argument being treated as
input text).
3.5.0 – November 30, 2005
New Features:
- ‘swift –voices’ now shows information about the software in addition
to the table of information about the installed voices.
3.4.2 – September 19, 2005
- No Changes
3.4.1 – September 2, 2005
- No Changes
3.4.0 – August 18, 2005
- No Changes
3.3.3 – August 5, 2005
- No Changes
3.3.2 – July 28, 2005
- No Changes
3.3.1 – July 12, 2005
Bug Fixes:
- FIXED: Setting swift.exe into phone mode and asking for event
information causes a crash.
- FIXED: ‘swift -V’ shows no lexicon information
3.3.0 – June 15, 2005
Bug Fixes:
- FIXED: swift -m wave fails with an invalid NULL param error.
- FIXED: Command-line swift will fail to play sound (wav, aiff) files
from disk if no voices are loaded.
New Features:
- If -m switch or text/content-type param isn’t set, command-line swift
is now able to do the right thing with the file based on its extension.
For instance:
‘swift -f myWave1.wav myTextFile.txt myWave2.wav’
Will play the two wave files and synthesize the text in the text file.
3.2.1 – April 01, 2005
- No Changes
3.2.0 – March 14, 2005
- swift –events now shows event information in a nicely formatted table.
3.1.1 – January 19, 2005
- No Changes
3.1.0 – December 13, 2004
New Features:
- Defaults to SSML mode for text parsing.
- Save-as-wave can now be done via ‘-o filename’ switch (No longer need
to set ‘audio/output-file’ param).
- ‘-f’ switch can be used to specify multiple input files, by making a
call like this:
swift -f file1.txt file2.txt file3.txt
- Ability to enter port license information.
- Ability to have a phoneme list as input by specifying ‘-m phones’.
- ‘-x’ switch for loading a sound effects file (.sfx).
- Can use ‘–register’ switch with ‘-n voice’ or with ‘-d directory’.
Bug Fixes:
- SSML support now working. No longer crashes when making this call:
swift “<voice name=’Frank’>Hello</voice>”
- ‘-f filename’ switch now works correctly when given with other switches
- Now provides feedback if the file given in ‘-f filename’ switch cannot
be opened.
- ‘swift –voices’ now prints a much nicer table of all installed voices
and their attributes.
- ‘swift -V’ now shows engine version number.
- If ‘swift -o filename’ fails to write the wave file for any reason, it
no longer leaves the bad output file laying around on the file system.
- An error is displayed if license file can’t be written during
‘swift –register’ or ‘swift –reg-ports’.
- Results of ‘swift –params’ have been checked and all options listed
actually work.
- ‘swift -p audio/encoding=[ulaw,alaw,pcm8]’ work now.
3.0.3 – September 30, 2004 [Linux only]
New Features:
- ‘-f’ switch can be used to specify multiple input files, by making a
call like this:
swift -f file1.txt file2.txt file3.txt
- Can use ‘–register’ switch with ‘-n voice’ or with ‘-d directory’.
Bug Fixes:
- ‘-f filename’ switch now works correctly when
given with other switches.
3.0.2 – September 13, 2004
- Initial Linux release.
3.0.0 – June 1, 2004
- Initial Release, bunded with 3.0.0 voices