Read Textby james_hThis add-on lets an external program read text from the OpenOffice.org application. If you use it with an external text-to-speech program, it can help you to edit your writing or to compare your document's text with a printed document. It can help you to learn a new language or to find out how to say words you do not know. To use it, highlight some text. If you are using writer or web writer you can highlight several selections by holding down the Control key. When you have highlighted some text, select Tools → Add-Ons → Read Selection or click the Read Selection button on the tool bar. If you have difficulties reading the screen, you might prefer to use a system-wide accessibility solution like Orca for the Gnome desktop or KTTS for the KDE desktop. If you have installed a system-wide accessibility solution, and it is activated, then this Add-On is not needed, and probably will not work properly. The add-on uses the temporary text files with an external program. Depending on the security set up of your computer, the contents of the text files may be readable by other users or programs. If you are concerned about privacy, launch this add-on again with no text selected to replace the temporary files that contain the text you want to remain confidential. The path and names of the temporary files are shown in the Command and Script areas of the About... dialog. Festival Festival text to speech is available for Czech, English, Finnish, Hindi, Italian, Marathi, Spanish, Russian and Telugu. With Festival, custom voices will only work if they are installed. If you try to use a voice that is not installed, Festival will be silent. Your package manager may not be able to install all the voices listed in the Read Selection script dialog. Voices that include “mbrola” in the name may need to be installed manually if you want to use them. If you are using Festival, see the Festival web page or the Ubuntu forum for instructions how to install voices from the mbrola project. The Festival package includes a tool for converting text to a wave sound file called text2wav. To use text2wav: Instructions for compiling Festival for Windows are available at http://www.cstr.ed.ac.uk/projects/festival/download.html eSpeak If you want to try eSpeak with Linux, and your distribution includes apt-get, use these commands to install it: Languages supported by eSpeak include Afrikaans, Albanian, Armenian, Bosnian, Catalan, Croatian, Czech, English, Esperanto, Finnish, French, German, Greek, Hungarian, Italian, Kurdish, Latin, Latvian, Mandarin, Polish, Romanian, Serbian, Slovak, Spanish, Swedish, Tamil, and Turkish. Versions of eSpeak for other operating platforms are available at http://espeak.sourceforge.net/. Use different languages and voices with Linux To get the add-on to speak in French, make sure you have installed Mbrola, eSpeak and aplay. Download the fr1: French Male (4.4Mb) voice from the Mbrola web site. With administrator privileges, extract the contents into a directory accessible to all users and set the permissions of the subdirectories and files to allow read access for all. To use the example script below, extract the zip file to /usr/share/festival/voices/fr/, which creates a directory /usr/share/festival/voices/fr/fr1. The bash script below reads a plain text file in French, and will work as long as there are no spaces in the file name or file path. Name this script read_in_french.sh and save it to ~/.gnome2/nautilus-scripts. Be sure to set the file permissions to allow the script to execute. (
Select some text in OpenOffice.org. Use different languages and voices with Windows Select some text in OpenOffice.org. Other Linux voice synthesizers License: opensource | Read license Further product information: Product details
|
||
Comments
Ubuntu 9.10 - If festival doesn't work
If you update to Ubuntu 9.10, and festival stops working, try the following:
The first time you run the updated distribution, the sound system may not work. Turn off your computer and restart it.
Configure festival to use ESD or PulseAudio. See the Ubuntu community help page for text to speech.
Configuration for ESD or PulseAudio
If you want festival to always use ESD or PulseAudio for output, you can configure this globally, for all users, or on a per-user basis. To configure globally use the configuration file /etc/festival.scm. To configure locally use the configuration file ~/.festivalrc.
1. Open the configuration file by typing,
gksudo gedit /etc/festival.scmorgedit ~/.festivalrcin a terminal.2. Add the following lines at the end of the file:
(Parameter.set 'Audio_Method 'esdaudio)3. Save the file.
This is the recommended method for playing audio in Ubuntu.
Linux - make an audio file for a podcast or your portable player
Use mbrola, eSpeak and lame to create an mp3 player compatible audio file with Linux
With the espeak, mbrola and lame packages, you can convert selected text to a mp3 compatible sound file using a script. Name this script french_recorder.sh and save it to ~/.gnome2/nautilus-scripts. Be sure to set the file permissions to allow the script to execute. (chmod a+rx ~/.gnome2/nautilus-scripts/french_recorder.sh).
#!/bin/sh# Reads or creates mp3 audio file of the contents of a text file in French.
if [ $# = 1 ]; then
# Read it aloud now
espeak -v mb-fr1 -f $1 | mbrola -e /usr/share/festival/voices/fr/fr1/fr1 - - | aplay -r16000 -fS16
else
# Save it as a temporary wave file, then convert to a mp3 file; then remove wav file
espeak -v mb-fr1 -f $1 | mbrola -e /usr/share/festival/voices/fr/fr1/fr1 - $HOME/.temp-44044o03.wav
lame $HOME/.temp-44044o03.wav $2
rm $HOME/.temp-44044o03.wav
totem $2
fi
Select some text in OpenOffice.org.
Show the Read Selection dialog with Tools → Add-Ons → Read Selection...
Select Read the Selection with another program
Browse to the path to the script – for example, ~/.gnome2/nautilus-scripts/french_recorder.sh. Note that if the file path includes a period as the first character, it is normally hidden in the file browser. You can either enable showing hidden files, or type the file path in the location bar.
If you want the script to create an MP3 audio file, in the command box, enter (TMP) (HOME)ooo_espeak_(NOW).mp3
If you want the script to read the text aloud, in the command box, enter (TMP)
Click OK.
Read Text
Wow! espeak with mbrolla en1 is really fantastic - allows checking of large documents
Thanks for your comment! About maximum string length
Thanks for your comment! According to the OpenOffice.org Wiki, the maximum length of a string in OpenOffice.org BASIC is 65535 characters. If you want to read an even longer selection, save your selection as a text file (i. e.: ~/test.txt) then use your system's command line or a script like the Linux bash script shown above to play the selection aloud. If you are using Linux with a Gnome desktop, and you saved your script to ~/.gnome2/nautilus-scripts, you can play the plain text file by right-clicking it and choosing your script from the scripts menu.
I have only tried the English and French mbrola voices. They are easy to understand. It is too bad that the set up is a little time consuming.