个人工具

“UbuntuHelp:TextToSpeech”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/TextToSpeech}}
 
{{From|https://help.ubuntu.com/community/TextToSpeech}}
 
{{Languages|UbuntuHelp:TextToSpeech}}
 
{{Languages|UbuntuHelp:TextToSpeech}}
 +
#title Text-to-Speech
  
  
== Introduction ==
+
You can take advantage of Text-To-Speech in Ubuntu by using a program called ''Festival''. Festival doesn't work with ESD (the default sound mixer) out of the box, so some changes are required to get it up and running.
  
You can take advantage of Text-To-Speech in Ubuntu by using a program called Festival. Because by default it doesn't work with ESD (the sound mixer that comes by default with Dapper), a little of manual tweaking is needed.
+
This guide provides instructions on how to get Festival working on Ubuntu with ESD. If you don't use Festival with ESD, you will have to disable ESD in the ''Sounds'' preferences dialog. In that case, other multimedia applications won't be able to play audio at the same time.
 
+
This is not meant to be a guide on how to use Festival (for that, read the Festival user docs), but simply how to get it working on Ubuntu with ESD. (If you don't use Festival with ESD, you will have to disable ESD in the "Sounds" preferences dialog. But in that case, your other multimedia apps won't be able to play audio at the same time.)
+
  
 
== Installation ==
 
== Installation ==
  
Install Festival (and related files)
+
* Install Festival by typing the following command in a Terminal:
 +
<pre><nowiki>sudo apt-get install festival
 +
</nowiki></pre>
 +
*#2 Install ''esdplay'', which is part of the ''esound-clients'' package:
 +
<pre><nowiki>sudo apt-get install esound-clients
 +
</nowiki></pre>
  
$ sudo apt-get install festival
+
'''Note:''' Additional voices are available in the Ubuntu respositories. Type "festival" in ''Synaptic Package Manager'' for a list of packages.
 
+
(Additional voices are available in the Ubuntu respositories. Type "festival" in synaptic for a list of packages.)
+
 
+
Install esdplay, which is part of the esound-clients package:
+
 
+
$ sudo apt-get install esound-clients
+
  
 
== Configuration ==
 
== Configuration ==
  
You need to configure festival so that it sends its output through ESD. Otherwise, you'll get the following error when you try to run Festival:  "can't open /dev/dsp".
+
You need to configure festival so that it sends its output through ESD. Otherwise, you will get a ''can't open /dev/dsp'' error when you try to run Festival.
 
+
Edit the /etc/festival.scm:
+
 
+
$ gksudo gedit /etc/festival.scm
+
 
+
Add the following lines at the end of the file:
+
  
 +
* Open the file ''/etc/festival.scm'' by typing <code><nowiki>gksudo gedit /etc/festival.scm</nowiki></code> in a Terminal.
 +
* Add the following lines at the end of the file:
 
<pre><nowiki>(Parameter.set 'Audio_Command "esdplay $FILE")
 
<pre><nowiki>(Parameter.set 'Audio_Command "esdplay $FILE")
 
(Parameter.set 'Audio_Method 'Audio_Command)
 
(Parameter.set 'Audio_Method 'Audio_Command)
 
(Parameter.set 'Audio_Required_Format 'snd)</nowiki></pre>
 
(Parameter.set 'Audio_Required_Format 'snd)</nowiki></pre>
 +
*#3 Save the file.
  
 
== Testing ==
 
== Testing ==
  
Test your setup by typing:
+
* Test your setup by typing <code><nowiki>festival</nowiki></code> in a Terminal.
 
+
* You will be presented with a ''>'' prompt. Type <code><nowiki>(Say``Text "Hello"</nowiki></code>.
$ festival
+
* The computer should say "hello".
 
+
* To listen to a text file type <code><nowiki>(tts "FILENAME" nil)</nowiki></code>. ''FILENAME'' must be in quote marks.
you'll be presented with a > prompt. Type:
+
 
+
> (Say``Text "Hello")
+
 
+
The computer should say "hello".
+
 
+
To listen to a text file type:
+
 
+
> (tts FILENAME nil)  
+
 
+
FILENAME must be in quote marks.
+
 
+
 
+
----
+
[[category:CategoryDocumentation]]
+
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2007年5月24日 (四) 14:41的版本

  1. title Text-to-Speech


You can take advantage of Text-To-Speech in Ubuntu by using a program called Festival. Festival doesn't work with ESD (the default sound mixer) out of the box, so some changes are required to get it up and running.

This guide provides instructions on how to get Festival working on Ubuntu with ESD. If you don't use Festival with ESD, you will have to disable ESD in the Sounds preferences dialog. In that case, other multimedia applications won't be able to play audio at the same time.

Installation

  • Install Festival by typing the following command in a Terminal:
sudo apt-get install festival
    1. 2 Install esdplay, which is part of the esound-clients package:
sudo apt-get install esound-clients

Note: Additional voices are available in the Ubuntu respositories. Type "festival" in Synaptic Package Manager for a list of packages.

Configuration

You need to configure festival so that it sends its output through ESD. Otherwise, you will get a can't open /dev/dsp error when you try to run Festival.

  • Open the file /etc/festival.scm by typing gksudo gedit /etc/festival.scm in a Terminal.
  • Add the following lines at the end of the file:
(Parameter.set 'Audio_Command "esdplay $FILE")
(Parameter.set 'Audio_Method 'Audio_Command)
(Parameter.set 'Audio_Required_Format 'snd)
    1. 3 Save the file.

Testing

  • Test your setup by typing festival in a Terminal.
  • You will be presented with a > prompt. Type (Say``Text "Hello".
  • The computer should say "hello".
  • To listen to a text file type (tts "FILENAME" nil). FILENAME must be in quote marks.