Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-release > by-pkgid > f1f429f1e7336a64acc418038325ad85 > files > 19

flite-1.4-7.mga5.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created on October 18, 2014 by texi2html 5.0
texi2html was written by: 
            Lionel Cons <Lionel.Cons@cern.ch> (original author)
            Karl Berry  <karl@freefriends.org>
            Olaf Bachmann <obachman@mathematik.uni-kl.de>
            and many others.
Maintained by: Many creative people.
Send bugs and suggestions to <texi2html-bug@nongnu.org>
-->
<head>
<title>Flite: a small, fast speech synthesis engine: 6 Structure</title>

<meta name="description" content="Flite: a small, fast speech synthesis engine: 6 Structure">
<meta name="keywords" content="Flite: a small, fast speech synthesis engine: 6 Structure">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 5.0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:pre}
span.nolinebreak {white-space:pre}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">

<a name="Structure"></a>
<table class="header" cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="flite_4.html#Flite-Design" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="flite_4.html#Key-Decisions" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[ Up ]</td>
<td valign="middle" align="left">[<a href="#cst_005fval" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left">[<a href="flite_6.html#APIs" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="flite.html#Abstract" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="flite_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="flite_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h1 class="chapter">6 Structure</h1>

<p>The flite distribution consists of two distinct parts:
</p><ul>
<li> The flite library containing the core synthesis code
</li><li> Voice(s) for flite.  These contain three sub-parts
<ul>
<li> Language models:
text processing, prosody models etc.
</li><li> Lexicon and letter to sound rules
</li><li> Unit database and voice definition
</li></ul>
</li></ul>

<hr>
<a name="cst_005fval"></a>
<table class="header" cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Structure" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Structure" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#Structure" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="flite_6.html#APIs" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left">[<a href="flite_6.html#APIs" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="flite.html#Abstract" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="flite_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="flite_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section">6.1 cst_val</h2>

<p>This is a basic simple object which can contain ints, floats, strings
and other objects.  It also allows for lists using the Scheme/Lisp,
car/cdr architecture (as that is the most efficient way to represent
arbitrary trees and lists).
</p>
<p>The <code>cst_val</code> structure is carefully designed to take up only 8 bytes (or
16 on a 64-bit machine).  The multiple union structure that it can
contain is designed so there are no conflicts.  However it depends on
the fact that a pointer to a <code>cst_val</code> is guaranteed to lie on a even
address boundary (which is true for all architectures I know of).  Thus
the distinction between between cons (i.e. list) objects and atomic
values can be determined by the odd/evenness of the least significant bits
of the first address in a <code>cst_val</code>.  In some circles this is considered
hacky, in others elegant. This was done in flite to ensure that the most
common structure is 8 bytes rather than 12 which saves significantly on
memory.
</p>
<p>All <code>cst_val</code>&rsquo;s except those of type cons are reference counted.  A
few functions generate new lists of <code>cst_val</code>&rsquo;s which the user
should be careful about as they need to explicitly delete them (notably
the lexicon lookup function that returns a list of phonemes).
Everything that is added to an utterance will be deleted (and/or
dereferenced) when the utterance is deleted.
</p>
<p>Like Festival, user types can be added to the <code>cst_val</code>s.  In
Festival this can be done on the fly but because this requires the
updating of some list when each new type is added, this wouldn&rsquo;t be
thread safe.  Thus an explicit method of defining user types is done in
&lsquo;<tt>src/utils/cst_val_user.c</tt>&rsquo;.  This is not as neat as defining on the
fly or using a registration function but it is thread safe and these
user types wont changes often.
</p>
<hr>
<table class="header" cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Structure" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="flite_6.html#APIs" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="flite.html#Abstract" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="flite_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="flite_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<p>
 <font size="-1">
  This document was generated on <i>October 18, 2014</i> using <a href="http://www.nongnu.org/texi2html/"><i>texi2html 5.0</i></a>.
 </font>
 <br>

</p>
</body>
</html>