1338 lines · 57.1 KB · Text
RawDownload
\input texinfo @c -*-texinfo-*-@c %**start of header@setfilename flite.info@settitle Flite: a small, fast speech synthesis engine@dircategory sound@direntryflite: (flite). a small, fast speech synthesis engine@end direntry@finalout@setchapternewpage odd@c %**end of header @c This document was modelled on the numerous examples of texinfo@c documentation available with GNU software, primarily the hello@c world example, but many others too.  I happily acknowledge their@c aid in producing this document -- awb @set EDITION 2.0@set VERSION 2.0@set UPDATED 18th November 2014 @ifinfoThis file documents @code{Flite}, a small, fast run-time speechsynthesis engine. Copyright (C) 2001-2014 Carnegie Mellon University Permission is granted to make and distribute verbatim copies ofthis manual provided the copyright notice and this permission noticeare preserved on all copies. @ignorePermission is granted to process this file through TeX, or otherwise andprint the results, provided the printed document carries copyingpermission notice identical to this one except for the removal of thisparagraph (this paragraph not being relevant to the printed manual). @end ignorePermission is granted to copy and distribute modified versions of thismanual under the conditions for verbatim copying, provided that the entireresulting derived work is distributed under the terms of a permissionnotice identical to this one. Permission is granted to copy and distribute translations of this manualinto another language, under the above conditions for modified versions,except that this permission notice may be stated in a translation approvedby the authors.@end ifinfo @titlepage@title Flite: a small, fast speech synthesis engine@subtitle System documentation@subtitle Edition @value{EDITION}, for Flite version @value{VERSION}@subtitle @value{UPDATED}@author by Alan W Black and Kevin A. Lenzo @page@vskip 0pt plus 1filllCopyright @copyright{} 2001-2014 Carnegie Mellon University, all rightsreserved. Permission is granted to make and distribute verbatim copies ofthis manual provided the copyright notice and this permission noticeare preserved on all copies. Permission is granted to copy and distribute modified versions of thismanual under the conditions for verbatim copying, provided that the entireresulting derived work is distributed under the terms of a permissionnotice identical to this one. Permission is granted to copy and distribute translations of this manualinto another language, under the above conditions for modified versions,except that this permission notice may be stated in a translation approvedby the Carnegie Mellon University@end titlepage @node Top, , , (dir) @menu* Abstract::            initial comments* Copying::             How you can copy and share the code* Acknowledgements::    List of contributors* Installation::        Compilation and Installation* Flite Design::* APIs::                 Standard functions* Converting FestVox Voices:: building flite voices from FestVox ones @end menu @node Abstract, Copying, , Top@chapter Abstract This document provides a user manual for flite, a small, fastrun-time speech synthesis engine. This manual is nowhere near complete. Flite offers text to speech synthesis in a small and efficient binary.It is designed for embedded systems like PDAs as well large serverinstallation which must serve synthesis to many ports.  Flite is partof the suite of free speech synthesis tools which include EdinburghUniversity's Festival Speech Synthesis System@url{http://www.festvox.org/festival} and CarnegieMellon University's FestVox project @url{http://festvox.org}, whichprovides tools, scripts, and documentation for building new syntheticvoices. Flite is written in ANSI C, and is designed to be portableto almost any platform, including very small hardware. Flite is really just a synthesis library that can be linked into otherprograms, it includes two simple voices with the distribution, an olddiphone voice and an example limited domain voice which uses the newerunit selection techniques we have been developing.  Neither of thesevoices would be considered production voices but serve as examples, newvoices will be released as they are developed. The latest versions, comments, new voices etc for Flite are availablefrom its home page which may be found at@example@url{http://cmuflite.org}@end example @node Copying, Acknowledgements, Abstract, Top@chapter Copying Flite is free software.  It is distributed under an X11-like license.Apart from the few exceptions noted below (which still havesimilarly open licenses) the general license is@example                  Language Technologies Institute                                          Carnegie Mellon University                                             Copyright (c) 1999-2014                       All Rights Reserved.                                                                                                  Permission is hereby granted, free of charge, to use and distribute   this software and its documentation without restriction, including    without limitation the rights to use, copy, modify, merge, publish,   distribute, sublicense, and/or sell copies of this work, and to       permit persons to whom this work is furnished to do so, subject to    the following conditions:                                              1. The code must retain the above copyright notice, this list of         conditions and the following disclaimer.                           2. Any modifications must be clearly marked as such.                  3. Original authors' names are not deleted.                           4. The authors' names are not used to endorse or promote products        derived from this software without specific prior written             permission.                                                                                                                             CARNEGIE MELLON UNIVERSITY AND THE CONTRIBUTORS TO THIS WORK          DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING       ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT    SHALL CARNEGIE MELLON UNIVERSITY NOR THE CONTRIBUTORS BE LIABLE       FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES     WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN    AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,           ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF        THIS SOFTWARE.                                                       @end example @node Acknowledgements, Installation, Copying, Top@chapter Acknowledgements The initial development of flite was primarily done by awb whiletravelling, perhaps the name is doubly appropriate as a substantialamount of the coding was done over 30,000ft).  During most of thattime awb was funded by the Language Technologies Institute atCarnegie Mellon University. Kevin A. Lenzo was involved in the design, conversion techniques andrepresentations for the voice distributed with flite (as well as beingthe actual voice itself). Other contributions are:@itemize @bullet@item Nagoya Institute of TechnologyThe MLSA, MLPG code comes directly NITECH's hts engine code, though wehave done some optimizations.@item Marcela Charfuelan (DFKI)For the mixed-excitation techniques (but no direct code).  Theseoriginally came from NITECH but we understood the techniques fromMarcela's Open Mary Java code and implemented them in our optimizedversion of MLSA.@item David Huggins-Daines:much of the very early clunits code, porting to multiple platforms,substantial code tidy up and configure/autoconf guidance (up to 2001).@item Cepstral, LLC (@url{http://cepstral.com}):For supporting DHD to spend time (in early 2001) on flite and passingback the important fixes and enhancements while on a project funded bythe Portuguese Foundation for Science and Technology (FCT) Praxis XXIprogram specifically to produce an open source synthesizer.@item Willie Walker <william.walker@@sun.com> and the Sun Speech Group:lots of low level bugs (and fixes).@item Henry Spencer:For the regex code@item University of Edinburgh:for releasing Festival for free, making a companion runtime synthesizera practical project, much of the design of flite relies on the architecture decisions made in the Festival Speech Synthesis Systems andthe Edinburgh Speech Tools. The duration cart tree and intonation (accent and F0) models for theUS English voice were derived from the models in the Festivaldistribution. which in turn were trained from the Boston University FMRadio Data Corpus. @item Carnegie Mellon UniversityThe included lexicon is derived from CMULEX and the letter to soundrules are constructed using the Lenzo and Black techniques forbuilding LTS decision graphs.@item Craig Reese: IDA/Supercomputing Research Center and Joe Campbell: Department of Defensewho wrote the ulaw conversion routines in src/speech/cst_wave_utils.c@end itemize  @node Installation, Flite Design, Acknowledgements, Top@chapter Installation Flite consist simple of a set of C files.  GNU configure isused to configure the engine and will work on mostmajor architectures. In general, the following should build the system@exampletar zxvf flite-XXX.tar.gzcd flite-XXX./configuremake@end exampleHowever you will need to explicitly call GNU make@code{gmake} if @code{make} is not GNU make on your system. The configuration process build a file @file{config/config} which undersome circumstances may need to be edited, e.g. to add unusual options ordealing with cross compilation. On Linux systems, we also support shared libraries which are useful forkeeping space down when multiple different application are linked to theflite libraries.  For development we strongly discourage use of sharedlibraries as it is too easy to either not set them up correctly oraccidentally pick up the wrong version.  But for installation they aredefinitely encouraged.  That is if you are just going to make andinstall they are good but unless you know what @var{LD_LIBRARY_PATH}does, it may be better to use static libraries (the default) if you arechanging C code or building your own voices.@example./configure --enable-sharedmake@end exampleThis will build both shared and static versions of the libraries butwill link the executables to the @emph{shared} libraries thus you willneed to install the libraries in a place that your dynamic linker willfind them (cf. /etc/ld.so.conf) or set @var{LD_LIBRARY_PATH}appropriately. @examplemake install@end exampleWill install the binaries (@file{bin/flite*}), include files andlibraries in appropriate subdirectories of the defined installdirectory, @file{/usr/local} by default.  You can change this at configuretime with@example./configure --prefix=/opt@end example @section Windows Support @section Window CE Support @emph{NOTE: as Windows CE is somewhat rare now, we do not guarantee thisstill works.} Flite has been successfully compiled by a number of different groupsunder Windows CE.  The system should compile under Embedded VisualStudio but we not have the full details. The system as distributed does compile under the gcc @file{mingw32ce}toolchain available from @url{http://cegcc.sourceforge.net/}.  Thecurrent version can be compiled and run under WinCE with a primitiveapplication called @file{flowm}.  @file{flowm} is a simple applicationthat allows playing of typed-in text, or full text to speech ona file.  Files should be a simple ascii text files @code{*.txt}.  Theapplication allows the setting of the byte position to start synthesisfrom. Assuming you have @file{mingw32ce} installed you can configure as@example./configure --target=arm-wincemake@end exampleThe resulting binary is given in @file{wince/flowm.exe}.  If you copythis onto your Windows Mobile device and run it, it should allow youto speak typed-in text and any @file{*.txt} files you have on yourdevice. The application uses @code{cmu_us_kal} as the voice for default.Although it is possible to include the clustergen voices, they may betoo slow to be really practical.  An 8KHz clustergen voice with areduced order to 13 gives a voices that runs acceptably on an hp2755(624MHz) but still marginal on an AT&T Tilt (400MHz). Building 8KHz clustergen voices is currently a bit of hack.  We take thestandard waveforms and resample them to 8KHz, then relabel the samplerate to be 16KHz.  Then build the voice as normal (as if the speakerspoke twice as fast.  You may need to have tune the F0 parameters in@file{etc/f0.params}.  This seems to basically work.  Then after thewaveform is synthesized (still in the "chipmunk'' domain) we thenplayit back at 8KHz.  This effectively means we generate half thenumber of samples and the frames are really at 10ms.  A secondreduction is an option on the basic @file{build_flite} command.  Asecond argument can specify order reduction, thus instead of thestandard 25 static parameters (plus its deltas) we can reduce this to13 and still get acceptable results@example./bin/build_flite cg 13cd flitemake@end exampleImportantly this uses less space, and uses less time to synthesis.These @code{SPEECH_HACKS} in @file{src/cg/cst_mlsa.c} are switched onby default when @code{UNDER_CE} is defined. The reduced order properly extracts the statics (and stddev) anddeltas (and stddev) from the predicted parameter clusters and makes itas if those were the sizes of parameters that were used to the trainthe voice.  @section PalmOS Support @emph{NOTE: as PalmOS is somewhat rare now, we do not guarantee thisstill works.} Support for PalmOS was removed from 1.9, I no longer have any workingPalmOS devices.  But this section remains for people who do, but theymay need to update something to make this work. Starting with 1.3 we have initial support for PalmOS using the freedevelopment tools.  The compilation method assumes the target deviceis running PalmOS 5.0 (or later) on an ARM processor.  Followingconvention in the Palm world, the app that the user interacts with isactually a m68k application compiled with the m68 gcc cross compiler,the resulting code is interpreted by the PalmOS 5.0 device.  The coreflite code is in native ARM, and hence uses the ARM gcc crosscompiler.  An interesting amout of support code is required to get all this work properly. The user app is called @code{flop} (FLite on Palm) and like most appswritten by awb, is functional, but ugly.  You should not let ashort-sighted Scotsman, who still thinks command line interfaces arecool, design a graphical app.  But it does work and can read typed-intext.  The @file{armflite.ro} resources are designed with the ideathat proper applications will be written using it as a library. The @file{flop.prc} application is distributed separately so it can be usedwithout having to install all these tools.  But if you want to PalmOSdevelopment here is what you need to do to compile Flite for PalmOS andthe flop application. There are number of different application development environments forPalm, here I only describe the Unix based one as this is what wasused.  You will need the PalmOS SDK 5.0 from palmOne@url{http://www.palmone.com/us/developers/}.  This isfree but does require registration.  Out of the lots of differentfiles you can get for palmOne you will eventually find@file{palmos-sdk-5.0r3-1.noarch.rpm}, install that on your linuxmachine@examplerpm -i palmos-sdk-5.0r3-1.noarch.rpm@end exampleYou will also need the various gcc based cross compilers@url{http://prc-tools.sourceforge.net/}@exampleprc-tools-2.3-1.i386.rpm                prc-tools-arm-2.3-1.i386.rpmprc-tools-htmldocs-2.3-1.noarch.rpm@end exampleThe Palm Resource compiler@url{http://pilrc.sourceforge.net/}@examplepilrc-3.1-1.i386.rpm@end exampleAnd maybe the emulator @url{http://www.palmos.com/dev/tools/emulator/}@examplepose-3.5-2.i386.rpmpose-skins-1.9-1.noarch.rpm             pose-skins-handspring-3.1H4-1.noarch.rpm @end exampleThough as POSE doesn't support ARM code, @file{Simulator} does butthat only works under Windows, POSE is only useful for debugging the m68k parts of the app. Install these@examplerpm -i prc-tools-2.3-1.i386.rpm                rpm -i prc-tools-arm-2.3-1.i386.rpmrpm -i prc-tools-htmldocs-2.3-1.noarch.rpmrpm -i pilrc-3.1-1.i386.rpmrpm -i pose-3.5-2.i386.rpmrpm -i pose-skins-1.9-1.noarch.rpm             rpm -i pose-skins-handspring-3.1H4-1.noarch.rpm @end exampleWe also need the prc-tools to know which SDK is available@examplepalmdev-prep@end exampleIn addition we use Greg Parker's PEAL@url{http://www.sealiesoftware.com/peal/} ELF ARM loader. You need todownload this and compile and install it yourself, so that@code{peal-postlink} is in your path.  Greg was very helpful and evenadded support for large data segments for this work (though in the endwe don't actually use them).  Some peal code is in our distribution(which is valid under his licence) but if you use a different versionof peal you may need to ensure they are matched, by updating the peal code in @file{palm/}.  We used version @file{peal-2004-12-29}. The other palm specific function we require is @code{par}@url{http://www.djw.org/product/palm/par/} which is part of the@code{prc.tgz} distribution.  We use @code{par} to construct resourcesfrom raw binary files.  There are other programs that can do this butwe found this one adequate.  Again you must compile this and ensure@code{par} is in your path.  Note no part of @code{par} ends upin the distributed system. Given all of the above you should be able to compile thePalm code and the @code{flop} application.@example   ./configure --target=arm-palmos   make@end exampleThe resulting application should be in @file{palm/flop/flop.prc}which can then be installed on your Plam device@example   pilot-xfer -i palm/flop/flop.prc@end exampleSetting up the tools, and getting a working Linux/Palm conduit is notparticularly easy but it is possible.  Although some attempt was madeto use the Simulator, (PalmOS 5.0/ARM simulator) under Windows, itnever really contributed to the development.  The POSE (m68k) emulatorthough was use to develop the @code{flop} application itself. @subsection Some notes on the PalmOS port Throughout the PalmOS developer documentation they continually remindyou that a Palm device is not a full computer, its an extention of thedesktop.  But seeing devices like the Treo 600 can easily make oneforget and want the device to do real computational work.  PalmOS isdesigned for small light weight devices so it is easy to start hittingthe boundaries of its capabilities when trying to port largeraplications. PalmOS5.0 still has interesting limitations, in the m68k domain,@code{int}'s are 16 bit and using memory segments greater than 65Krequire special work.  Quaint as these are, they do significantlyaffect the port.  At first we thought that only the keycomputationally expensive parts would be in ARM (so-called@code{armlets}) but trying to compile the whole flite code in m68kwith long/short distinctions and sub-64K code segment limitations wasjust too hard. Thus all the Flite code, USEnglish, Lexicon and diphone databasesactually are compiled in the ARM domain.  There is however no systemsupport in the ARM domain so call backs to m68k system functions arenecessary.  With care calls to system functions can be significantlylimited so only a few call backs needed to be written.  These are in@file{palm/pocore/}.  I believe CodeWarrior has better support forthis, but in this case we rolled our own (though help from other opensource examples was important). We manage the m68k/ARM interface through PEAL, which is basically alinker for ARM code and calling mechanism from m68k.  PEAL deals withglobals and spliting the code into 65K chunks automatically. Flite does however have a number of large data segments, in thelexicon and the voice database itself.  PEAL can deal with this but itloads large segments by copying them into the dynamic heap, which onmost Palm device is less than 2M.  This isn't big enough. Thus we changed Flite to restrict the number of large data sgements itused (and also did some new compression on them).  The five segments: thelts rules, the lexical entries, the voice LPC coefficients, the voiceresiduals and the voice residual index are now treated a data segmentsthat are split into 65400 sized segments and loaded into featurememory space, which is in the storage heap and typically much bigger.This means we do need about 2-3 megabyte free on the device to run.We did look into just indexing the 65400 byte segments directly butthat looked like being too much work, and we're only going to be ableto run on 16M sized Palms anyway (there aren't any 8M ARM Palms with audio, expect maybe some SmartPhones). Using Flite from m68k land involves getting a @code{flite_info}structure from @code{flite_init()}.  This contains a bunch of fieldsthat be set and sent to the ARM domain Flite synthesizer proper withinwhich other output fields may be set and returned.  This isn't a verygeneral structure, but is adequate.  Note the necessary byte swapping(for the top level fileds) is done for the this structure, beforecalling the ARM native @code{arm_flite_synth_text} and swapped backagain after returning. 

Lines 1–500 of 1338.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t