A small fast portable speech synthesis system
Flite: a small run-time speech synthesis engine version 2.1-release Copyright Carnegie Mellon University 1999-2022 All rights reserved http://cmuflite.org https://github.com/festvox/flite
Flite is an open source small fast run-time text to speech engine. It is the latest addition to the suite of free software synthesis tools including University of Edinburgh's Festival Speech Synthesis System and Carnegie Mellon University's FestVox project, tools, scripts and documentation for building synthetic voices. However, flite itself does not require either of these systems to compile and run.
The core Flite library was developed by Alan W Black (mostly in his so-called spare time) while employed in the Language Technologies Institute at Carnegie Mellon University. The name "flite", originally chosen to mean "festival-lite" is perhaps doubly appropriate as a substantial part of design and coding was done over 30,000ft while awb was travelling, and (usually) isn't in meetings.
The voices, lexicon and language components of flite, both their compression techniques and their actual contents were developed by Kevin A. Lenzo and Alan W Black .
Flite is the answer to the complaint that Festival is too big, too slow, and not portable enough.
o Flite is designed for very small devices, such as phones, portables, PDAs, and also for large server machines which need to serve lots of ports.
o Flite is not a replacement for Festival but an alternative run-time engine for voices developed in the FestVox framework where size and speed is crucial.
o Flite is all in ANSI C, it contains no C++ or Scheme, thus requires more care in programming, and is harder to customize at run-time.
o It is thread safe
o Voices, lexicons and language descriptions can be compiled (mostly automatically for voices and lexicons) into C representations from their FestVox formats
o All voices, lexicons and language model data are const and in the text segment (i.e. they may be put in ROM). As they are linked in at compile time, there is virtually no startup delay. Voices may also be loaded from a single file (or across an http connection).
o Although the synthesized output is not exactly the same as the same voice in Festival they are effectively equivalent. That is, flite doesn't sound better or worse than the equivalent voice in festival, just faster, smaller and scalable.
o For standard diphone voices, maximum run time memory requirements are approximately less than twice the memory requirement for the waveform generated. For 32bit architectures this effectively means under 1M.
o The flite program supports, synthesis of individual strings or files (utterance by utterance) to direct audio devices or to waveform files.
o The flite library offers simple functions suitable for use in specific applications.
Flite is distributed with a single 8K diphone voice (derived from the cmu_us_kal voice), a pruned lexicon (derived from cmulex) and a set of models for US English. Here are comparisons with Festival using basically the same 8KHz diphone voice
Flite Festival
core code 60K 2.6M
USEnglish 100K ??
lexicon 600K 5M
diphone 1.8M 2.1M
runtime bin/flite: WebAssembly (wasm) binary module version 0x1 (MVP)
Usage:
------
The ./bin/flite binary contains all supported voices and you may
choose between the voices with the -voice flag and list the supported
voices with the -lv flag. Note the kal (diphone) voice is a different
technology from the others and is much less computationally expensive
but more robotic. For each voice additional binaries that contain
only that voice are created in ./bin/flite_FULLVOICENAME,
e.g. ./bin/flite_cmu_us_awb. You can also refer to external clustergen
.flitevox voice via a pathname argument with -voice (note the pathname
must contain at least one "/")
If it compiles properly a binary will be put in bin/, note by
default -g is on so it will be bigger than is actually required
./bin/flite "Flite is a small fast run-time synthesis engine" flite.wav
Will produce an 8KHz riff headered waveform file (riff is Microsoft's
wave format often called .WAV).
./bin/flite doc/alice
Will play the text file doc/alice. If the first argument contains
a space it is treated as text otherwise it is treated as a filename.
If a second argument is given a waveform file is written to it,
if no argument is given or "play" is given it will attempt to
write directly to the audio device (if supported). if "none"
is given the audio is simply thrown away (used for benchmarking).
Explicit options are also available.
./bin/flite -v doc/alice none
Will synthesize the file without playing the audio and give a summary
of the speed.
./bin/flite doc/alice alice.wav
will synthesize the whole of alice into a single file (previoous
versions would only give the last utterance in the file, but
that is fixed now).
An additional set of feature setting options are available, these are
*debug* options, Voices are represented as sets of feature values (see
lang/cmu_us_kal/cmu_us_kal.c) and you can override values on the
command line. This can stop flite from working if malicious values
are set and therefor this facility is not intended to be made
available for standard users. But these are useful for
debugging. Some typical examples are
Use simple concatenation of diphones without prosodic modification
./bin/flite --sets join_type=simple_join doc/intro
Print sentences as they are said
./bin/flite -pw doc/alice
Make it speak slower
./bin/flite --setf duration_stretch=1.5 doc/alice
Make it speak higher pitch
./bin/flite --setf int_f0_target_mean=145 doc/alice
The talking clock is an example talking clode as discussed on
http://festvox.org/ldom it requires a single argument HH:MM
under Unix you can call it
./bin/flite_time `date +%H:%M`
List the voices linked in directly in this build
./bin/flite -lv
Speak with the US male rms voice (builtin version)
./bin/flite -voice rms -f doc/alice
Speak with the "Scottish" male awb voice (builtin version)
./bin/flite -voice awb -f doc/alice
Speak with the US female slt voice
./bin/flite -voice slt -f doc/alice
Speak with AEW voice, download on the fly from festvox.org
./bin/flite -voice http://festvox.org/flite/packed/flite-2.1/voices/cmu_us_aew.flitevox -f doc/alice
Speak with AHW voice loaded from the local file.
./bin/flite -voice voices/cmu_us_ahw.flitevox -f doc/alice
You can download the available voices into voices/
./bin/get_voices us_voices
and/or
./bin/get_voices indic_voices
Voice quality
-------------
So you've eagerly downloaded flite, compiled it and run it, now you
are disappointed that it doesn't sound wonderful, sure its fast and
small but what you really hoped for was the dulcit tones of a deep
baritone voice that would make you desperately hang on every phrase it
mellifluously produces. But instead you get an 8Khz diphone voice that
sounds like it came from the last millenium.
Well, first, you are right, it is an 8KHz diphone voice from the last
millenium, and that was actually deliberate. As we developed flite we
wanted a voice that was stable and that we could directly compare with
that very same voice in Festival. Flite is an *engine*. We want to
be able take voices built with the FestVox process and compile them
for flite, the result should be exactly the same quality (though of
course trading the size for quality in flite is also an option). The
included voice is just a sample voice that was used in the testing
process.
We expect that often voices will be loaded from external files, and we
have now set up a voice repository in
http://festvox.org/flite/packed/flite-2.1/voices/*.flitevox
If you visit there with a browser you can hear the examples. You can
also download the .flitevox files to you machine so you don't need a
network connect everytime you need to load a voice.
We are now actively adding to this list of available voices in English (16)
and other languages.
Bard Storyteller: https://github.com/festvox/bard
--------------------------------------------------
Bard is a companion app that reads ebooks, both displaying them and
actually reading them to you out loud using flite. Bard supports a
wide range of fonts, and flite voices, and books in text, html and
epub format. Bard is used as a evaluation of flite's capabilities and
an example of a serious application using flite.No open issues yet, or sync has not completed.