Espeak TTS Chinese and English real people pronunciation engine

Source: Internet
Author: User

Espeak TTS Chinese and English real people pronunciation engine Tcl/tk extension and espeak API example.
Please indicate the source when reprint: http://www.tcltk.cn

Watching the Paralympic Games over the past few days is really a big sensation. There are so many spectators cheering for athletes with disabilities, seeing the hard work of athletes on the field, and hearing the stories behind the athletes, sometimes it's really red. "Everyone has a soft side in their hearts." ---- this sentence is a good one. It seems that my brother is also impatient.
Now, let's get started. I have been searching for the Chinese TTS engine that can be voiced in Linux. This is not the case, but it is still bilingual in China/Guangdong! This is the espeak. After reading the espeak API today, swig is used to package an extension tclespeak of Tcl/TK. Of course, you can also simply modify the MAKEFILE file so that you can easily compile their own espeak extensions for python, Perl, Ruby, Lua, Java, and other languages.
Tclespeak extensions use the lgpl license, and commercial software can also be freely used. By the way, I don't know if I can use Tcl/TK? Using the powerful fast development capabilities of Tcl/tk combined with tclespeak to write a reading software for Linux I want to write it in just a few days. If anyone has time, write a message for the benefit of discerning, blind, and elderly people. Thank you. My brother, I can't do it. This year's work and study plan is full. It's really just a heel-it's so busy. However, I am still very helpful in the development.
Finally, they care about the disabled and cannot only watch the Paralympic Games. Please take your own actions to sympathize with, care for, and help the disabled, and encourage and support them in spirit. Thank you.

Compile tclespeak extension:
If you are using Ubuntu, you can skip this step and download the compiled code directly:
Http://tclespeak.googlecode.com/files/tclespeak1.0-ubuntu.tar.gz
-------------------------------
Wget http://tclespeak.googlecode.com/files/tclespeak1.0.tar.gz
Tar zxvf tclespeak1.0.tar.gz
CD tclespeak
Sudo make install_dev_pkg
Make
-------------------------------

Add Chinese/Cantonese bilingual support for the espeak in the system (system-independent ):
For Windows, you must manually enter the two commands in makefile.
After successful addition, you can test the command in the terminal window: espeak-vzh "Hello, world! "
-------------------------------
Wget http://tclespeak.googlecode.com/files/dictsource.tar.gz
Tar zxvf dictsource.tar.gz
CD dictsource
Sudo make
-------------------------------

Sample Code for Tcl/TK:
-------------------------------
Package require espeak

Set en_word "Hello, world ."
Set zh_word "Hello, world! "

Espeak E

# MALE VOICE.
E Lang "en"
E speak $ en_word

# FEMALE voice.
E Lang "En + F2"
E speak $ en_word

# Chinese Male Voice in Mandarin.
E Lang "ZH"
E speak $ zh_word

# FEMALE voice in Mandarin.
E Lang "zh + F2"
E speak $ zh_word

# Cantonese Chinese Male Voice.
E Lang "Zhy"
E speak $ zh_word

# FEMALE voice in Cantonese.
E Lang "Zhy + F2"
E speak $ zh_word
-------------------------------
For more information, see:
Tclespeak project home page Co., http://www.tcltk.cn.

Let's take a look at the C/C ++ code, which is much more complicated to write:
-------------------------------
# Include <espeak/speak_lib.h>

Char en_word [] = "Hello, world .";
Char zh_word [] = "Hello, world! ";

Espeak_initialize (audio_output_playback, 0, null, 0 );

// Male voice.
Espeak_setvoicebyname ("en ");
Espeak_synth (word, strlen (en_word) + 1, 0, pos_character, 0, espeakchars_utf8, null, null );

// Female voice.
Espeak_setvoicebyname ("En + F2 ");
Espeak_synth (word, strlen (en_word) + 1, 0, pos_character, 0, espeakchars_utf8, null, null );

// Chinese Male Voice in Mandarin.
Espeak_setvoicebyname ("ZH ");
Espeak_synth (word, strlen (zh_word) + 1, 0, pos_character, 0, espeakchars_utf8, null, null );

// Female voice in Mandarin.
Espeak_setvoicebyname ("zh + F2 ");
Espeak_synth (word, strlen (zh_word) + 1, 0, pos_character, 0, espeakchars_utf8, null, null );

// Chinese Male Voice in Cantonese.
Espeak_setvoicebyname ("Zhy ");
Espeak_synth (word, strlen (zh_word) + 1, 0, pos_character, 0, espeakchars_utf8, null, null );

// Cantonese mandarin voice.
Espeak_setvoicebyname ("Zhy + F2 ");
Espeak_synth (word, strlen (zh_word) + 1, 0, pos_character, 0, espeakchars_utf8, null, null );

Espeak_terminate ();

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.