Sophie

Sophie

distrib > Mageia > 2 > i586 > by-pkgid > a2e5ae2091c2674a899ba2cbfce176e5 > files > 34

festival-2.1-3.mga1.i586.rpm

<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.52
     from ../festival.texi on 2 August 2001 -->

<TITLE>Festival Speech Synthesis System - 23  Audio output</TITLE>
</HEAD>
<BODY bgcolor="#ffffff">
Go to the <A HREF="festival_1.html">first</A>, <A HREF="festival_22.html">previous</A>, <A HREF="festival_24.html">next</A>, <A HREF="festival_35.html">last</A> section, <A HREF="festival_toc.html">table of contents</A>.
<P><HR><P>


<H1><A NAME="SEC96" HREF="festival_toc.html#TOC96">23  Audio output</A></H1>

<P>
<A NAME="IDX289"></A>
If you have never heard any audio ever on your machine then you must
first work out if you have the appropriate hardware.  If you do, you
also need the appropriate software to drive it.  Festival can directly
interface with a number of audio systems or use external
methods for playing audio.  

</P>
<P>
The currently supported audio methods are
<DL COMPACT>

<DT><SAMP>`NAS'</SAMP>
<DD>
<A NAME="IDX290"></A>
 <A NAME="IDX291"></A>
 
NCD's NAS, is a network transparent audio system (formerly called
netaudio).  If you already run servers on your machines you
simply need to ensure your <CODE>AUDIOSERVER</CODE> environment variable
is set (or your <CODE>DISPLAY</CODE> variable if your audio output device is the
same as your X Windows display).
You may set NAS as your audio output method by the command

<PRE>
(Parameter.set 'Audio_Method 'netaudio)
</PRE>

<A NAME="IDX292"></A>
<A NAME="IDX293"></A>
<DT><SAMP>`/dev/audio'</SAMP>
<DD>
On many systems <TT>`/dev/audio'</TT> offers a simple low level method for
audio output.  It is limited to mu-law encoding at 8KHz.  Some
implementations of <TT>`/dev/audio'</TT> allow other sample rates and sample
types but as that is non-standard this method only uses the common
format.  Typical systems that offer these are Suns, Linux and FreeBSD
machines.  You may set direct <TT>`/dev/audio'</TT> access as your audio
method by the command

<PRE>
(Parameter.set 'Audio_Method 'sunaudio)
</PRE>

<A NAME="IDX294"></A>
<A NAME="IDX295"></A>
<DT><SAMP>`/dev/audio (16bit)'</SAMP>
<DD>
Later Sun Microsystems workstations support 16 bit
linear audio at various sample rates.  Support for this form
of audio output is supported.  It is a compile time option (as
it requires include files that only exist on Sun machines.  If
your installation supports it (check the members of the list
<CODE>*modules*</CODE>) you can select 16 bit audio output on
Suns by the command

<PRE>
(Parameter.set 'Audio_Method 'sun16audio)
</PRE>

Note this will send it to the local machine where the festival binary
is running, this might not be the one you are sitting next to--that's
why we recommend netaudio.  A hacky solution to playing audio on a local
machine from a remote machine without using netaudio is described
in section <A HREF="festival_6.html#SEC12">6  Installation</A>
<DT><SAMP>`/dev/dsp (voxware)'</SAMP>
<DD>
<A NAME="IDX296"></A>
<A NAME="IDX297"></A>
<A NAME="IDX298"></A>
<A NAME="IDX299"></A>
Both FreeBSD and Linux have a very similar audio interface through
<TT>`/dev/dsp'</TT>.  There is compile time support for these in the speech
tools and when compiled with that option Festival may utilise it.
Check the value of the variable <CODE>*modules*</CODE> to see which audio
devices are directly supported.  On FreeBSD, if supported, you
may select local 16 bit linear audio by the command

<PRE>
(Parameter.set 'Audio_Method 'freebsd16audio)
</PRE>

While under Linux, if supported, you may use the command

<PRE>
(Parameter.set 'Audio_Method 'linux16audio)
</PRE>

Some earlier (and smaller machines) only have 8bit audio even though
they include a <TT>`/dev/dsp'</TT> (Soundblaster PRO for example).  This was
not dealt with properly in earlier versions of the system but now the
support automatically checks to see the sample width supported and uses
it accordingly.  8 bit at higher frequencies that 8K sounds better than
straight 8k ulaw so this feature is useful.

<A NAME="IDX300"></A>
<A NAME="IDX301"></A>
<DT><SAMP>`mplayer'</SAMP>
<DD>
Under Windows NT or 95 you can use the <TT>`mplayer'</TT> command which
we have found requires special treatement to get its parameters right.
Rather than using <CODE>Audio_Command</CODE> you can select this on 
Windows machine with the following command

<PRE>
(Parameter.set 'Audio_Method 'mplayeraudio)
</PRE>

Alternatively built-in audio output is available with

<PRE>
(Parameter.set 'Audio_Method 'win32audio)
</PRE>

<A NAME="IDX302"></A>
<A NAME="IDX303"></A>
<DT><SAMP>`SGI IRIX'</SAMP>
<DD>
Builtin audio output is now available for SGI's IRIX 6.2 using
the command

<PRE>
(Parameter.set 'Audio_Method 'irixaudio)
</PRE>

<A NAME="IDX304"></A>
<DT><SAMP>`Audio Command'</SAMP>
<DD>
Alternatively the user can provide a command that can play an audio
file.  Festival will execute that command in an environment where the
shell variables <CODE>SR</CODE> is set to the sample rate (in Hz) and
<CODE>FILE</CODE> which, by default, is the name of an unheadered raw, 16bit
file containing the synthesized waveform in the byte order of the
machine Festival is running on.  You can specify your audio play command
and that you wish Festival to execute that command through the following
command

<PRE>
(Parameter.set 'Audio_Command "sun16play -f $SR $FILE")
(Parameter.set 'Audio_Method 'Audio_Command)
</PRE>

On SGI machines under IRIX the equivalent would be

<PRE>
(Parameter.set 'Audio_Command 
           "sfplay -i integer 16 2scomp rate $SR end $FILE")
(Parameter.set 'Audio_Method 'Audio_Command)
</PRE>

</DL>
<P>
The <CODE>Audio_Command</CODE> method of playing waveforms Festival supports
two additional audio parameters. <CODE>Audio_Required_Rate</CODE> allows you
to use Festival's internal sample rate conversion function to any desired
rate.  Note this may not be as good as playing the waveform at the
sample rate it is originally created in, but as some hardware devices
are restrictive in what sample rates they support, or have naive
resample functions this could be optimal.  The second additional
audio parameter is <CODE>Audio_Required_Format</CODE> which can be
used to specify the desired output forms of the file.  The default
is unheadered raw, but this may be any of the values supported by 
the speech tools (including nist, esps, snd, riff, aiff, audlab, raw
and, if you really want it, ascii).  For example suppose you
have a program that only plays sun headered files at 16000 KHz you can
set up audio output as

<PRE>
(Parameter.set 'Audio_Method 'Audio_Command)
(Parameter.set 'Audio_Required_Rate 16000)
(Parameter.set 'Audio_Required_Format 'snd)
(Parameter.set 'Audio_Command "sunplay $FILE")
</PRE>

<P>
<A NAME="IDX305"></A>
Where the audio method supports it, you can specify alternative audio
device for machine that have more than one audio device.

<PRE>
(Parameter.set 'Audio_Device "/dev/dsp2")
</PRE>

<P>
<A NAME="IDX306"></A>
<A NAME="IDX307"></A>
If Netaudio is not available and you need to play audio on a
machine different from teh one Festival is running on we have
had reports that <TT>`snack'</TT> (<A HREF="http://www.speech.kth.se/snack/">http://www.speech.kth.se/snack/</A>)
is a possible solution.  It allows remote play but importnatly
also supports Windows 95/NT based clients.

</P>
<P>
<A NAME="IDX308"></A>
<A NAME="IDX309"></A>
Because you do not want to wait for a whole file to be synthesized
before you can play it, Festival also offers an <EM>audio spooler</EM>
that allows the playing of audio files while continuing to synthesize
the following utterances.  On reasonable workstations this allows the
breaks between utterances to be as short as your hardware allows them
to be.

</P>
<P>
The audio spooler may be started by selecting asynchronous 
mode

<PRE>
(audio_mode async)
</PRE>

<P>
This is switched on by default be the function <CODE>tts</CODE>.
You may put Festival back into synchronous mode (i.e. the <CODE>utt.play</CODE>
command will wait until the audio has finished playing before returning).
by the command

<PRE>
(audio_mode sync)
</PRE>

<P>
Additional related commands are
<DL COMPACT>

<DT><CODE>(audio_mode 'close)</CODE>
<DD>
Close the audio server down but wait until it is cleared.  This is
useful in scripts etc. when you wish to only exit when all audio is
complete.
<DT><CODE>(audio_mode 'shutup)</CODE>
<DD>
Close the audio down now, stopping the current file being played and
any in the queue.  Note that this may take some time to take effect 
depending on which audio method you use.  Sometimes there can be
100s of milliseconds of audio in the device itself which cannot
be stopped.
<DT><CODE>(audio_mode 'query)</CODE>
<DD>
Lists the size of each waveform currently in the queue.
</DL>

<P><HR><P>
Go to the <A HREF="festival_1.html">first</A>, <A HREF="festival_22.html">previous</A>, <A HREF="festival_24.html">next</A>, <A HREF="festival_35.html">last</A> section, <A HREF="festival_toc.html">table of contents</A>.
</BODY>
</HTML>