IT Новости с интернет пространства
0 просмотров
Рейтинг статьи
1 звезда2 звезды3 звезды4 звезды5 звезд

Linux text to speech

Ubuntu Documentation

See https://help.ubuntu.com/community/Accessibility for a discussion of the screen reader Orca .

See http://www.dotdeb.com to download a .deb package of the Ubuntu Text Reader. This text reader uses festival as its engine and is capable of changing audio devices. It was programmed on Ubuntu for Ubuntu. It comes with 4 voices and the option to download several others. It has been tested on Ubuntu 8.04, 8.10, 9.04, 9.10, 10.04, 10.10.

Espeak is the default text-to-speech / speech synthesizer software that comes pre-installed on Ubuntu 10.10 and 11.04 Natty.

There is a gui front-end for it in the Ubuntu Software Center: Gespeaker. And even you can find/install mbrola voices from there (show technical items)

Check out http://code.google.com/p/gespeaker/ too, for how to configure mbrola voices.

Reading text from clipboard

To read highlighted text with gespeaker (ver. 0.8.1) create a keyboard shortcut (ie. Super + R)

bash -c «gespeaker —play-text=»$(xsel | sed -e :a -e ‘$!N;s/n/ /;ta’)»»


Note: xsel does not come preinstalled (sudo apt-get install gespeaker xsel)

Using a Terminal you can try this out:

Make some sound in english:

    espeak -v en "Hello i am espeak"

    Learn more about espeak in its man page:

      It works with existing sound server software. The home web page for this package can be found at http://espeak.sourceforge.net/.

      A nice list of options for espeak available here:


      Another Text-To-Speech option for Ubuntu is a program called Festival.

      NOTE: Out of the box, Festival doesn’t work with ESD (the default sound server up to Gutsy), Pulse Audio (the default sound server since Hardy) or ALSA, 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, Pulse Audio and ALSA.

      If you are using a version of Ubuntu prior to Hardy, and you don’t want to 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.


      Install Festival by typing the following command in a Terminal:

        sudo apt-get install festival

        Note: Additional voices are available in the Ubuntu repositories. Type «festvox» in Synaptic Package Manager for a list of language packages.

        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

        Open the configuration file by typing gksudo gedit /etc/festival.scm or gedit

        /.festivalrc in a terminal.
        Add the following lines at the end of the file:

        (Parameter.set 'Audio_Method 'esdaudio)

      • Save the file.
      • This is the recommended method for playing audio in Ubuntu.

        Configuration for ALSA

        Note: It is hard to use ALSA and ESD on the same system, if it is possible at all. Here it is assumed that you are using ALSA instead of ESD.

        Insert at the end of the file /etc/festival.scm or

        /.festivalrc the lines

        On some configurations it may be necessary to remove the «-D plug:dmix» part of the aplay command above.


        Test your setup by typing in a Terminal

          You will be presented with a > prompt. Type

            The computer should say «hello».

            To listen to a text file named FILENAME, type

              Note FILENAME must be in quote marks.

              TextToSpeech (последним исправлял пользователь caf4926 2013-09-07 06:18:33)

              The material on this wiki is available under a free license, see Copyright / License for details
              You can contribute to this wiki, see Wiki Guide for details

              eSpeak: Text To Speech Tool For Linux

              Last updated November 30, 2015 By Abhishek Prakash 4 Comments

              eSpeak is a command line tool for Linux that converts text to speech. This is a compact speech synthesizer that provides support to English and many other languages. It is written in C.

              eSpeak reads the text from the standard input or the input file. The voice generated, however, is nowhere close to a human voice. But it is still a compact and handy tool if you want to use it in your projects.

              Some of the main features of eSpeak are:

              • A command line tool for Linux and Windows
              • Speaks text from a file or from stdin
              • Shared library version for use by other programs
              • SAPI5 version for Windows, so it can be used with screen-readers and other programs that support the Windows SAPI5 interface.
              • Ported to other platforms, including Android, Mac OSX etc.
              • Several voice characteristics to choose from
              • speech output can be saved as .WAV file
              • SSML (Speech Synthesis Markup Language) is supported partially along with HTML
              • Tiny in size, the complete program with language support etc is under 2 MB.
              • Can translate text into phoneme codes, so it could be adapted as a front end for another speech synthesis engine.
              • Development tools available for producing and tuning phoneme data.

              Install eSpeak

              To install eSpeak in Ubuntu based system, use the command below in a terminal:

              eSpeak is an old tool and I presume that it should be available in the repositories of other Linux distributions such as Arch Linux, Fedora etc. You can install eSpeak easily using dnf, pacman etc.

              To use eSpeak, just use it like: espeak and press enter to hear it aloud. Use Ctrl+C to close the running program.

              There are several other options available. You can browse through them through the help section of the program.

              GUI version: Gespeaker

              If you prefer the GUI version over the command line, you can install Gespeaker that provides a GTK front end to eSpeak.

              Use the command below to install Gespeaker:

              The interface is straightforward and easy to use. You can explore it all by yourself.

              While such tools might not be useful for general computing need, it could be handy if you are working on some projects where text to speech conversion is required. I let you decide the usage of this speech synthesizer.

              Читать еще:  Linux pkg install

              Like what you read? Please share it with others.

              About Abhishek Prakash

              I am a professional software developer, and founder of It’s FOSS. I am an avid Linux lover and open source enthusiast. I use Ubuntu and believe in sharing knowledge. Apart from Linux, I love classic detective mysteries. I’m a huge fan of Agatha Christie’s work.

              I am very much impressed with your work. I think there is lot of work to be done on signal processing part to make it more realistic. I would love to work on that part. Please let me know if that is possible (Mr. Abhishek Prakash).

              Awesome Linux

              Fight for the Internet 1!

              Wednesday, April 22, 2009

              Text to Speech in Linux

              After using my friend’s Amazon Kindle 2 and its Text-to-Speech (TTS) feature to read something I had written, I became interested in getting a TTS program for my own use. The best solution I have found was a combination of KDE’s Text-to-Speech manager and an external TTS program.

              KDE’s readily available TTS system integration makes me proud of how the open-source and Linux communities attempt to help people for free.

              Part 1 Choosing a TTS Program
              Most TTS software in Linux does not seem to provide a graphical user interface for control, just a command line utility. This utility can be tied to a graphical controller, but first you must choose which TTS program option is right for you.

              Option #1: For the Free of Charge or Open-Source only People
              For the people not willing to pay for any TTS software (and yes, there is some good stuff available for Linux), or for those who will only use completely Open-Source material, Festival + some other voices is probably your best option.

              Festival is a general multi-lingual speech synthesis system and it is probably the first thing one will encounter when researching TTS in Linux. It is well supported in Linux and I personally was able to get it to read a text file within minutes.

              To get it to work with kttsmgr, there was no editing of configuration files necessary, but to use it directly from command line I had to add this /etc/festival.scm for ALSA sound support:
              (Parameter.set ‘Audio_Command «aplay -D plug:dmix -q -c 1 -t raw -f s16 -r $SR $FILE»)
              (Parameter.set ‘Audio_Method ‘Audio_Command)
              (Parameter.set ‘Audio_Required_Format ‘snd) In festival, the voice synthesis is pretty good, though I found it sometimes too fast, particularly over some punctuation, and the voice is obviously synthetic. If you are hoping for something a little different, read about solution #2.

              If you are interested in using Festival, but want different voices, Option #2’s voices can be made to work with Festival as well.

              MBROLA will frequently pop up on Google during TTS searches, or at least it did for me. Wikipedia explains this project better than I, but simply put: It is a free system for enhancing the quality of TTS systems, but it is not itself a full TTS system. MBROLA can be used along with Festival, as the tutorial link above will show.

              This webpage is a great resource for the many numerous TTS systems and projects in Linux and the open-source world. If you want additionally information about TTS and other related projects, I suggest you go there.

              Option #2: Purchased voiced & Closed source
              For those willing to pay a little to buy a TTS voice and are willing to use a closed source TTS project, I suggest Cepstral. Their product is very high quality and is available for Linux (32 and 64 bit), Windows and Mac OS. Take a look at their demos and you can tell fairly quickly if their product is right for you.

              Their Windows version comes with a nice and simply GUI program to read text, and provides graphical configuration of the programs voice, which is fairly customizable. Their Linux version(s), as far as I can tell, comes with only a command line utility, but they product documention on their website FAQs about using their program with KDE’s TTS manager.

              Part 2 Configuring a Frontend Graphical Controller
              While there may be other controllers, I used KDE’s program: kttsmgr. This is their Text-To-Speech manager and it supports a great variety of TTS command line programs.

              There are plenty of tutorials on getting Festival to work with kttsmgr.

              Update: Besides making sure you install a festival voice, I am not even sure any additional configuration is necessary beyond going through the kttsmgr and adding a talker.

              Option #2 Cepstral with kttsmgr
              [Taken from Cepstral’s own FAQ docs]
              To integrate Cepstral voices into the KTTS text-to-speech system (present in KDE 3.4 or later), first select KTTS from the KDE menu or run kttsmgr from the command line to open the configuration manager.

              In the Talkers tab, click the Add button to add a new voice. Now, select the «Show All» option for synthesizers, choose the Command synthesizer, and click OK. You’ll now be asked to choose a language. Select anything here, as it will be ignored. Finally, it’s time to specify the swift command to run. To speak using the default voice, use:

              If you want a specific voice, use the -n switch like this:

              swift %t -o %w -n Isabelle

              You’ll also want to select Latin1 as the character set. Click OK, then Apply to set the current voice. Your voice should now work in any KDE app that uses KTTS. I found that selecting UTF-8 instead of Latin1 caused no problems, but I am also not using any sort of foreign language texts.

              High quality text to speech

              ebenfarnworth said: February 2nd, 2013

              High quality text to speech

              I have been trying to find a good solution to TTS on Linux for about 8 months now and have done quite a bit of reading around. I have decided to post information on what I have found already as it may be useful to someone out there… However the question I’m trying to answer really is how to get a high quality voice like the ones from Cepstral working in Ubuntu or any other linux distribution? www.cepstral.com a closed source program costing around $40. I can get it running fine in the command line but can’t find a suitable interface using it on a day to day bases.

              Читать еще:  Подключение к удаленному рабочему столу linux

              I require a tts program to help me proofread nearly everything I write as without it I almost always have to many mistakes. There is not only good tts for Windows and Mac but for Android and ISO, so it should not be beyond the realms of possibility to have a working solution on linux.

              First for the Linux one tts, festival, its very impressive that all this work has been done both free and open source. I have tried out some of the different voices, the ones people say are the best but they are still not good enough. Someone also wrote a nice simple bash script to use with festival and xsel. Then you can set a keyboard command to trigger it you have a very nice tts system. The script is from: http://hak5.org/episodes/haktip-51 & http://www.ghacks.net/2010/10/09/lin. with-festival/

              Now if we could find a way to use the cepstral swift engine in the same way, for me it would for fill all my needs.

              Here is a forum post on how to make festival use better voices, but they were still not as good as the cepstral ones: http://ubuntuforums.org/showthread.php?t=751169

              Then there are screen readers like orca, which maybe grate for their intended use to read the whole screen for blind people and must stay running in the back ground all the time. However orca to me is not easy to use and I have not found a way to set it up to read only what I highlight or copy to the clipboard. But it has built in drivers for both cepstral swift, festival and espeak.

              KDE 3 seems to have had the perfect solution, with its ktts that could be used as a front end for festival, cepstral, espeak, and others. But in KDE 4 its been replaced with Jovie which in its current state of development can only connect to espeak. I also cannot find any information if its possible to run kde 3 apps on KDE 4 and also no where to download the old ktts. Here is a grate tutorial on how to set up ktts but as ktts is now obsolete its useless: http://awesomelinux.blogspot.jp/2009. -in-linux.html

              Gespeaker can be used as a front end to some speech engines (espeak and other voices) but dose not proved good enough quality results. Also with some of the talkers it’s not possible to stop them once they have started reading.

              This is a company (Digital Future ® http://www.digitalfuturesoft.com) who have a linux front end for cepstral which they say they can sell for $99.

              Dear customer
              The version is experimental and it needs to be built and recompiled for ur version of Linux.
              We can provide it for $99. Let us know if you agree and we will send you the secure payment link.
              The adaptation process may take up to 2 weeks.
              Let us know.
              SupportDigital Future ® Team

              I’m not shore about spending $99 on a program which is experimental and only dose what comes built into windows, mac and iso.

              http://www.wizzardsoftware.com lso have high quality voices for Linux but out of my budget.

              SVOX pico2wave https://launchpad.net/ubuntu/precise/+source/svox/ have a very light wait system which is quite customisable and can create many different voices. But not really suitable for reading back lots of text at a time it seems to crash and was not clear enough for my purposes. Here is the recommended bash script:

              The google chrome extension speakit uses tts from an online server to convert text to speech however this is also not a good solution for an expat living in China working over very slow internet connections: https://chrome.google.com/webstore/d. hrome-ntp-icon.

              JSpeak is a newer tts with a nice simple gui, but still lacks the quality I’m looking for.

              So thats most of the relevant research I have done so far. I’m shore I have mist stuff out!… Please post any other solutions you have found below; all idea’s are welcome.
              I’m most interested in a bash scrip to pipe text into cepstral swift or if anyone has brought the Digital Future software before, was it worth it?

              Thanks in advance, Eben

              frytek said: February 2nd, 2013

              Re: High quality text to speech

              It is also possible to install SAPI server on wine and use a SAPI voice. Tested to work with Ivona (http://www.ivona.com/us/ ) and Acapela (http://www.acapela-group.com/text-to. tive-demo.html) voices.
              Demo voices from acapela work for one hour, then you have to reboot the wine SAPI server.
              Demo voices from Ivona work as long as you don’t turn your computer off, you have to run the installation/configuration script after each reboot. Registered versions should work infinitely.

              Let me know if you want to know the details, because this solution has also no GUI.

              Basically, you have to add this ppa:

              and install sapi4linux, libivolektor1, libsapilektor, libsapilektor-utils. Then check the README file in /usr/lib/sapi4linux/ on how to download and run demo voices within a separate wine environment. That guarantees 1. it will work 2. it will not interfere with your other wine programs, if any.

              You need a command line to read a file aloud or to produce wav/mp3.

              It is possible to choose one of installed voices, speed, pauses length and so on.

              The results are quite nice:

              A typical command line for making a file would be something like:
              sapilektor -a -r -s 1.3 -v salli test.txt — | lame —preset voice -r -m m -s 22050 — test_salli_ivona.mp3

              To listen to a file use:
              sapilektor -s 1.3 -v Amy -o test.txt

              ebenfarnworth said: February 6th, 2013

              Re: High quality text to speech

              gaetanlord said: May 8th, 2013

              Re: High quality text to speech

              Having some issue to implement.
              I did install the sapilektor, and coud run it with your command mentionned with voice like Mike and Sam

              Читать еще:  Linux shadow файл

              I did download ivona voice (2), but can’t seem to get ot work
              The file I have in my ivoina_voice are

              Not sure if they are the one I should expect, README mention 2 small files and many big (voice). I only have one small.

              They are both in the ivona_voice directory under the sapi4linux directory

              How could I use them, I did reinstall sapi4linux and force erasing the files. I do get a message that ivona voices are installed but when running your command It fail.

              sapilektor -a -r -s 1.3 -v chantal meteo — | lame —preset voice -r -m m -s 22050 — meteo.mp3

              also sapiconfig -n only return mike, sam and Mary]

              Thank for any help

              bobbiescap said: May 19th, 2013

              Re: High quality text to speech

              pc-athome said: August 2nd, 2013

              Re: High quality text to speech

              Ultimate Edition (can’t pinpoint it in my collection — yet) used a closed source application for voices but it is ‘free’ — http://www.mbrola.com/

              I understand the issue with using this pack is that recompiling the kernel has to be done in order for it to still work after kernel updates — can’t remember where I read it.

              frytek said: September 11th, 2013

              Re: High quality text to speech

              pushkarajthorat said: January 17th, 2014

              Re: High quality text to speech

              As Ivona 3 voices not available and acapela ‘s voices for only french language is available. Hence these steps are no longer functional.

              Could you please upload the installables you have (with which you ‘ve created those mp3 files) so that it could be used.

              ИТ База знаний


              — Узнать IP — адрес компьютера в интернете

              — Онлайн генератор устойчивых паролей

              — Онлайн калькулятор подсетей

              — Калькулятор инсталляции IP — АТС Asterisk

              — Руководство администратора FreePBX на русском языке

              — Руководство администратора Cisco UCM/CME на русском языке

              — Руководство администратора по Linux/Unix


              Серверные решения


              FreePBX и Asterisk

              Настройка программных телефонов

              Корпоративные сети

              Протоколы и стандарты

              Популярное и похожее

              FreePBX 13 настройка c нуля

              Asterisk — настройка с нуля

              Сравнение FreeSWITCH и Asterisk

              Вход в FreePBX без логина и пароля

              Русский TTS в FreePBX 13

              Text-to-speech в Asterisk

              Технология TTS (text-to-speech) служит для преобразования текстовой информации в голос. Проще говоря, вы пишите – система проговаривает. В системах телефонной связи такая технология может быть полезна, если необходимо произнести баланс клиента или для озвучивания прочих голосовых сообщений. О том, как настроить TTS в FreePBX 13 с помощью командной строки Asterisk расскажем в статье.

              Встроенный TTS

              В FreePBX предусмотрен встроенный движок для TTS, который носит название filte. Движок хорошо отрабатывает английскую речь, но не умеет работать с русской. Вкратце ознакомимся с его настройкой. Тут все достаточно тривиально, переходим в Applications -> Text to Speech

              • Name — дайте имя для TTS механизма
              • Text — укажите произносимый системой набор слов
              • Choose an Engine — выберите движок для воспроизведения. По умолчанию, единственным доступным является filte
              • Destination — куда будет отправлен звонок, после проговаривания фразы указанной в поле Text

              На этом этапе система произнесет набор слов по-английски. Писать методом транслитерации – плохая идея. Движок конечно произнесет указанные слова, но это вряд ли можно будет отправить в «продакшн». Итак, как же бесплатно настроить русскоговорящий TTS в FreePBX? Легко, с помощью системы синтеза речи festival

              Русский язык FreePBX Festival

              Установку будем производить на примере последней сборки FreePBX Distro на базе CentOS 6. Переходим к установке. Скачиваем исходные файлы

              Распаковываем архивы и инсталлируем необходимые файлы

              Система может потребовать установить пакет ncurses-devel. Сделайте это с помощью команды yum install ncurses-devel

              Создаем переменную PATH, которая описывает путь до исполняемых файлов в директории festival/bin/

              Создадим директорию для хранения русскоязычных файлов. Для этого, последовательно в директории festival/lib/ создадим папки /voices и /russian:

              Скачиваем русскоязычный бандл:

              Далее, распаковываем скачанный архив в созданную директорию:

              Открываем через редактор vim файл /usr/src/festival/lib/languages.scm

              В самом начале файла вставляем следующие строки:

              В файле находим строки указанные ниже:

              После указанных выше строк, добавляем следующее:

              Далее открываем файл /usr/src/festival/lib/siteinit.scm и в самый конец добавляем строку ниже:

              Создаем кэш – директорию. Для этого, скопируйте команду ниже:

              Открываем файл /etc/asterisk/festival.conf и добавляем следующие строки:

              Запускаем сервер festival

              Если все успешно, то вы увидите строки ниже:

              Приступаем к тестам. Открываем файл /etc/asterisk/extensions_custom.conf и создаем тестовый диал – план как указано ниже:

              Сохраняем изменения. Для того, чтобы настроить воспроизведение из графического интерфейса FreePBX мы воспользуемся модулем Custom Destinations. Для его настройки перейдите во вкладку Admin -> Custom Destinations . Нажимаем на кнопку Add Destination

              Разберем каждую из опций:

              • Target — укажите здесь festival,s,1, согласно созданному ранее диал-плану. Синтаксис заполнения следующий — [имя_контекста],[экстеншен],[приоритет]
              • Description — описание создаваемого правила
              • Notes — заметки. Если вы создаете много подобных правил, советуем создавать подробные заметки, чтобы избежать дальнейшей путаницы.
              • Return — если ваш контекст заканчивается командой Return (команда возвращает вызов в родительский контекст), то в поле Destination укажите назначение для вызова после отработки TTS.

              По окончанию настроек нажмите Submit и затем Apply Config.

              Теперь необходимо настроить маршрутизацию на кастомный контекст, который мы только что создали в FreePBX. Например, можно настроить маршрутизацию из IVR меню по нажатию цифры 5 на телефоне, как указано ниже:

              Звоним на IVR и нажимаем 5 и слышим синтезированный голос. Параллельно смотрим на запущенный через CLI сервер Festival:

              Google TTS в FreePBX

              Еще пару лет назад можно было бы легко воспользоваться Google TTS для синтеза речи. Для этого надо было добавить движок во вкладке Settings -> Text To Speech Engines и отредактировать файл /var/lib/asterisk/agi-bin/propolys-tts.agi . Но, к сожалению, Google начал использовать капчу, чем перекрыл автоматизированный и бесплатный доступ к своему сервису.

              Дополнительно про настройку TTS от Festival вы можете прочитать здесь.

              Полезна ли Вам эта статья?

              Пожалуйста, расскажите почему?

              Нам жаль, что статья не была полезна для вас 🙁 Пожалуйста, если не затруднит, укажите по какой причине? Мы будем очень благодарны за подробный ответ. Спасибо, что помогаете нам стать лучше!

              Подпишитесь на нашу еженедельную рассылку, и мы будем присылать самые интересные публикации 🙂 Просто оставьте свои данные в форме ниже.

              Ссылка на основную публикацию