Home > Article > Operation and Maintenance > Can tts be used in linux?
Can. In Linux, you can use the Ekho software to implement the TTS (text-to-speech) function; you only need to download and install the Ekho software, and you can use the ekho command to convert text to speech, with the syntax "ekho "text"". Ekho is a free, open source Chinese speech synthesis software that supports Linux, Windows and Android platforms.
The operating environment of this tutorial: linux7.3 system, Ekho 8.6, Dell G3 computer.
In the process of user interaction software development, voice prompt requirements are often encountered. Voice prompts are a relatively direct way of interaction and can effectively improve user experience. Currently, the more common solutions include Baidu Voice Platform and iFlytek Voice Platform. These platforms generally call online services through APIs. The advantage is that the converted voice is relatively accurate, pronounced by real people, and there are a variety of voice package options. The disadvantage is that it relies on the Internet, cannot be used when the network is disconnected, requires a fee, and has a limit on the number of uses. Of course, you can choose offline SDK development for these platforms. Different platforms provide different SDK platforms. There is currently no support for the embedded arm platform. Of course, if the voice prompts are relatively few and relatively fixed, it is also a simple and fast solution to record the voice first and play the voice file directly when using it.
For the embedded arm platform, the Linux system is used. When there is no network and the voice prompt is uncertain, the TTS engine can only be used to solve the problem. After many searches, I finally found an open source Chinese TTS software Ekho (Yuyin) that is more suitable.
Ekho (Yuyin) is a free, open source Chinese speech synthesis software. It currently supports Cantonese, Mandarin (Mandarin), Guangdong Taishan dialect, Zhao'an Hakka, Tibetan, Yayan (the lingua franca of ancient China) and Korean (under trial), and English is implemented indirectly through eSpeak or Festival. Ekho supports Linux, Windows and Android platforms.
Ekho download address: http://www.eguidedog.net/cn/ekho_cn.php
sudo apt-get install espeak-ng libespeak-ng-dev libsndfile1-dev libpulse-dev libncurses5-dev libestools-dev festival-dev libvorbis-dev libmp3lame-dev libdotconf-dev texinfo pulseaudio libpulse-ocaml-dev
tar xJvf ekho-xxx.tar.xz
cd ekho-xxx
./configure
make -j4
sudo make install
ekho "你好呀"
If the sound can not be played normally, there may be a problem with the system's sound card settings, please check. Another reason may be that the pulseaudio service has not been started.
pulseaudio -start
Execute ekho "Hello!" again, and you will hear a mechanical voice.
Generate voice filesekho "你好。请继续保持努力!" -o holdon.wav
Finally set the pulseaudio service to automatically start at boot. This step is set as needed
pulseaudio --start --log-target=syslog
in /etc/rc.local Add
pulseaudio --start --log-target=syslog to the file to set it to start automatically every time you turn on the computer. Related recommendations: "
The above is the detailed content of Can tts be used in linux?. For more information, please follow other related articles on the PHP Chinese website!