Difference between revisions of "Festival"

From ArchWiki
Jump to navigation Jump to search
(→‎Sound server: remove flag, rw)
 
(93 intermediate revisions by 39 users not shown)
Line 1: Line 1:
{{stub}}
+
[[Category:Accessibility]]
 +
[[Category:Multimedia]]
 +
[[ja:Festival]]
 +
[[pt:Festival]]
 +
[[ru:Festival]]
 +
[http://www.cstr.ed.ac.uk/projects/festival/ Festival] is a general multi-lingual speech synthesis system developed at CSTR ([http://www.cstr.ed.ac.uk/ Centre for Speech Technology Research]). It offers a general framework for building speech synthesis systems as well as including examples of various modules. As a whole it offers full text to speech through a number APIs: from shell level, though a Scheme command interpreter, as a C++ library, from Java, and an Emacs interface. Festival is multi-lingual (currently British English, American English, Italian, Czech and Spanish, with other languages available in prototype.)
  
=Introduction=
+
== Installation ==
[http://www.cstr.ed.ac.uk/projects/festival/ Festival] is a general multi-lingual speech synthesis system developed at CSTR ([http://www.cstr.ed.ac.uk/ Centre for Speech Technology Research]).
 
  
=Step 1: Installation=
+
[[Install]] the {{Pkg|festival}} package. Voices are available with {{Pkg|festival-us}} and {{Pkg|festival-english}} packages.
Festival is in the extra repository so:
 
# pacman -S festival
 
  
You will also need to install one or more voices because by default there is no voice to speak with.
+
=== German IMS ===
  
=Step 2: Add voices=
+
The [http://www.ims.uni-stuttgart.de IMS of the University Stuttgart] developed an extension to Festival especially for German language (see [http://www.ims.uni-stuttgart.de/institut/arbeitsgruppen/phonetik/synthesis/festival_opensource.html here]). It uses German voices with {{AUR|mbrola}}. To use it, install {{AUR|festival-ims}} with IMS Stuttgart patches. This should add support for the german voices ''de1'' through ''de4''. Install at least one of the voices (listed as optional dependencies), e.g. {{AUR|mbrola-voices-de2}}.
==American English==
 
American English male voice `kal' 16kHz version:
 
# pacman -S festival-kallpc16k
 
==British English==
 
British English male voice `rab' 16kHz version:
 
# pacman -S festival-rablpc16k
 
==Other voices==
 
Other voices are available for Festival, some of them can be found in [[AUR]].
 
# yaourt festival
 
  
=Step 3: Testing and debugging=
+
== Configuration ==
To test festival lets make it speak an example text:
 
$ echo "This is an example. Seems like I'm working fine."|festival --tts
 
If your hear all the example text below: congratulations, you just installed a TTS system.
 
  
If you don't hear anything, something strange or just the beginning of the example sentence continue below.
+
There is no global {{ic|/etc/}} configuration file, but you can configure festival with your {{ic|~/.festivalrc}} file, or by directly editing {{ic|/usr/share/festival/festival.scm}}. Both of these are scheme files, using scheme syntax and rerun everytime festival is run.
 +
 
 +
=== Sound server ===
 +
 
 +
The following allows Festival to work if audio from other sources is already playing. Add to your config:
 +
 
 +
For PulseAudio:
 +
 
 +
(Parameter.set 'Audio_Required_Format 'aiff)
 +
(Parameter.set 'Audio_Method 'Audio_Command)
 +
(Parameter.set 'Audio_Command "paplay $FILE --client-name=Festival --stream-name=Speech")
 +
 
 +
For ALSA: [http://web.archive.org/web/20110522202347/http://ubuntuforums.org/showthread.php?t=171182&page=3]
 +
 
 +
(Parameter.set 'Audio_Method 'Audio_Command)
 +
(Parameter.set 'Audio_Command "aplay -q -c 1 -t raw -f s16 -r $SR $FILE")
 +
 
 +
=== Voices ===
 +
 
 +
Arch splits the set of official voices into {{Pkg|festival-us}} (recommended) and {{Pkg|festival-english}}. The [https://aur.archlinux.org/packages/?K=festival AUR] has some others, in various states of maintenance which may or may not be currently working.
 +
 +
To see what voices are currently installed and what the default is, first enter Festival's [[#Interactive]] shell (a REPL scheme). To permanently change the default voice add it to your config, for example:
 +
 
 +
(set! voice_default voice_cmu_us_rms_cg)
 +
 
 +
==== Manually ====
 +
 
 +
You can also get voices straight from Festvox [http://festvox.org/festival/downloads.html] [http://festvox.org/packed/festival/2.5/voices/]. You will need to unzip and move the folder containing the voice to {{ic|/usr/share/festival/voices/}} and the way to tell what folder contains the voice is to look for a {{ic|festvox/}} subfolder inside of it. You can then test that your new voices are found by loading up the festival prompt.
 +
 
 +
== Usage ==
 +
 
 +
To read a text file:
 +
 
 +
$ festival --tts ''text_file''
 +
 
 +
To read a selection you highlighted with the cursor:
 +
 
 +
$ xsel | festival --tts
 +
 
 +
Convert a text file to an mp3 audio:
 +
 
 +
$ text2wave ''text_file'' | lame - ''text''.mp3
 +
 
 +
Record audio with a select voice:
 +
 
 +
$ text2wave -o ''output''.wav -eval '(voice_german_de2_os)' ''text_file''
 +
 
 +
=== Interactive ===
 +
 
 +
Festival has an interactive prompt you can use for testing. Type {{ic|festival}} to enter it. The following are some examples:
 +
 
 +
To show the voice festival speaks with:
 +
   
 +
voice_default
 +
 
 +
To list available voices:
 +
 
 +
(voice.list)
 +
 
 +
To select another voice, enter {{ic|(''voice_name'')}}. For example:
 +
 
 +
(voice_cmu_us_rms_cg)
 +
 
 +
To hear it speak:
 +
 
 +
(SayText "Arch makes me happy")
 +
 
 +
To list available commands:
 +
 
 +
help
 +
 
 +
To exit the shell:
 +
 
 +
(quit)
 +
 
 +
== Troubleshooting ==
 +
 
 +
=== Can't open /dev/dsp ===
  
==can't open /dev/dsp==
 
 
If festival returns the following error message:
 
If festival returns the following error message:
 +
 
  Linux: can't open /dev/dsp
 
  Linux: can't open /dev/dsp
  
Switch to ALSA output by adding these lines to the end of your .festivalrc file, or to /usr/share/festival/festival.scm ([http://ubuntuforums.org/showpost.php?p=4058268&postcount=16 source]):
+
See [[#Sound server]] above.
(Parameter.set 'Audio_Method 'Audio_Command)
+
 
(Parameter.set 'Audio_Command "aplay -q -c 1 -t raw -f s16 -r $SR $FILE")
+
=== Alsa playing at wrong speed ===
 +
 
 +
If the solution above gives you a squeaky voice, you might want to try changing your ''aplay'' options:
  
==Alsa playing @ wrong speed==
 
If the solution above gives you Mr. Squeaky Voice, you might want to try:
 
 
  (Parameter.set 'Audio_Method 'Audio_Command)
 
  (Parameter.set 'Audio_Method 'Audio_Command)
 
  (Parameter.set 'Audio_Command "aplay -Dplug:default -f S16_LE -r $SR $FILE")
 
  (Parameter.set 'Audio_Command "aplay -Dplug:default -f S16_LE -r $SR $FILE")
... instead.
+
 
= Configuration & Usage =
+
=== Command aplay not found ===
== Setting default voice ==
+
 
No idea yet
+
Install the {{Pkg|alsa-utils}} package.
== Something about apps you can make use it perhaps ==
+
 
No idea yet
+
=== Server ===
 +
 
 +
Install {{AUR|festival-freebsoft-utils}} to use Festival with Speech Dispatcher (i.e. in Firefox's Reader).
 +
 
 +
== See also ==
 +
 
 +
* [http://festvox.org/docs/manual-2.4.0/ Festival manual]

Latest revision as of 19:50, 9 December 2019

Festival is a general multi-lingual speech synthesis system developed at CSTR (Centre for Speech Technology Research). It offers a general framework for building speech synthesis systems as well as including examples of various modules. As a whole it offers full text to speech through a number APIs: from shell level, though a Scheme command interpreter, as a C++ library, from Java, and an Emacs interface. Festival is multi-lingual (currently British English, American English, Italian, Czech and Spanish, with other languages available in prototype.)

Installation

Install the festival package. Voices are available with festival-us and festival-english packages.

German IMS

The IMS of the University Stuttgart developed an extension to Festival especially for German language (see here). It uses German voices with mbrolaAUR. To use it, install festival-imsAUR with IMS Stuttgart patches. This should add support for the german voices de1 through de4. Install at least one of the voices (listed as optional dependencies), e.g. mbrola-voices-de2AUR.

Configuration

There is no global /etc/ configuration file, but you can configure festival with your ~/.festivalrc file, or by directly editing /usr/share/festival/festival.scm. Both of these are scheme files, using scheme syntax and rerun everytime festival is run.

Sound server

The following allows Festival to work if audio from other sources is already playing. Add to your config:

For PulseAudio:

(Parameter.set 'Audio_Required_Format 'aiff)
(Parameter.set 'Audio_Method 'Audio_Command)
(Parameter.set 'Audio_Command "paplay $FILE --client-name=Festival --stream-name=Speech")

For ALSA: [1]

(Parameter.set 'Audio_Method 'Audio_Command)
(Parameter.set 'Audio_Command "aplay -q -c 1 -t raw -f s16 -r $SR $FILE")

Voices

Arch splits the set of official voices into festival-us (recommended) and festival-english. The AUR has some others, in various states of maintenance which may or may not be currently working.

To see what voices are currently installed and what the default is, first enter Festival's #Interactive shell (a REPL scheme). To permanently change the default voice add it to your config, for example:

(set! voice_default voice_cmu_us_rms_cg)

Manually

You can also get voices straight from Festvox [2] [3]. You will need to unzip and move the folder containing the voice to /usr/share/festival/voices/ and the way to tell what folder contains the voice is to look for a festvox/ subfolder inside of it. You can then test that your new voices are found by loading up the festival prompt.

Usage

To read a text file:

$ festival --tts text_file

To read a selection you highlighted with the cursor:

$ xsel | festival --tts

Convert a text file to an mp3 audio:

$ text2wave text_file | lame - text.mp3

Record audio with a select voice:

$ text2wave -o output.wav -eval '(voice_german_de2_os)' text_file

Interactive

Festival has an interactive prompt you can use for testing. Type festival to enter it. The following are some examples:

To show the voice festival speaks with:

voice_default 

To list available voices:

(voice.list)

To select another voice, enter (voice_name). For example:

(voice_cmu_us_rms_cg)

To hear it speak:

(SayText "Arch makes me happy") 

To list available commands:

help

To exit the shell:

(quit)

Troubleshooting

Can't open /dev/dsp

If festival returns the following error message:

Linux: can't open /dev/dsp

See #Sound server above.

Alsa playing at wrong speed

If the solution above gives you a squeaky voice, you might want to try changing your aplay options:

(Parameter.set 'Audio_Method 'Audio_Command)
(Parameter.set 'Audio_Command "aplay -Dplug:default -f S16_LE -r $SR $FILE")

Command aplay not found

Install the alsa-utils package.

Server

Install festival-freebsoft-utilsAUR to use Festival with Speech Dispatcher (i.e. in Firefox's Reader).

See also