Java text speech conversion component jtts released (espeak encapsulation)

Source: Internet
Author: User

: Http://greenvm.googlecode.com/files/JTTSEngine.7z
(Examples and source code are included. Currently, only DLL encapsulation is provided)

 

As we all know, TTS is short for Text to Speech, that is, "converting Text to Speech ".

The main function of TTS technology is to use computers to synthesize human languages and convert text information into voice information for playback. Simply put, the TTS technology gives computers the ability to "speak people.

As a computer technology with a long history, TTS is widely used. Not only can it be used to read emails and perform voice prompts on the IVR System (Interactive Voice Response), but it can also be easily embedded into games or other types of applications to enhance user experience. It is particularly important that TTS technology plays an irreplaceable key role in situations where you cannot obtain detailed text consultation (such as voice messaging platforms or blind services.

The functions to be implemented for TTS requirements mainly include the following parts:

1. Text Analysis: linguistic analysis is performed on input texts, and vocabulary, syntax, and semantics are analyzed one by one sentence to determine the lower-layer structure of a sentence and the composition of phoneme of each word, it includes sentence breaking, word splitting, processing of polyphonic words, processing of numbers, and processing of abbreviations.

2. Speech Synthesis: extract the word or phrase corresponding to the processed text from the speech synthesis database and convert the linguistic description into a speech waveform.

3. Rhythm processing: it is used to control the quality of the speech output by the speech synthesis system. Generally, subjective evaluations can be made in terms of clarity, naturalness, and coherence.

However, even if the above is not difficult from a purely technical perspective, developing the TTS engine is still a headache.

In addition to the development of the core architecture, TTS applications still have a lot of work to sample, classify, and correct specific words, phrases, and fixed statements, otherwise, it will not be able to meet the most basic requirements of "anthropomorphic. In a sense, the essence of these time-consuming repetitive jobs seems to be closer to physical labor rather than technical fields in a strict sense. Therefore, for the TTS engine makers, the physical labor intensity required will be far beyond the cost of mental labor (if not, developers who charge TTS engines will be starved to death ......).

Fortunately, we live in an international environment that is more and more open-source. Even if you don't write a word, there are countless ready-made wheels to drive, you don't have to spend money to purchase expensive commercial engines, and you don't have to start from scratch.

For example, jtts, a Java TTS component, is encapsulated based on the espeak, a famous open-source TTS component. (We are not arrogant (addicted) to the need to develop the TTS engine independently, so we follow Google's JNI encapsulation of espeak ......)

The espeak Project address is as follows: http://espeak.sourceforge.net
):

Espeak is a compact open-source software speech synthesizer that allows you to edit and modify the dictionary by yourself. It is a cost-effective and reasonable open-source TTS solution. It supports a variety of languages including Chinese (including Cantonese) (unfortunately, both the standard Chinese dictionary and the extended dictionary are incomplete, and the pronunciation is not very nice. If you want to use it, change it slowly, it's open source ......), Cross-platform running on Linux and Windows (requires separate compilation ). It is worth mentioning that the TTS engine used in Google Android is also espeak. In the following address: http://eyes-free.googlecode.com
To download the espeak package for Android.

About jtts:

In fact, jtts only uses the "vest engine" after a simple encapsulation of espeak (it's strange that no one has released a Java version package before, even PHP, Python, ruby version ......), The usage is basically the same as that of espeak, but the specific implementation is simpler and easier for friends who are not familiar with C/C ++.

Currently, the espeak interface has been encapsulated as follows (if you have time in the future (currently, you are mainly using lgame in your spare time). I will add more interfaces to jtts and gradually expand the application ):

Static native int initialize (string path); <br/> static native void synth (string text); <br/> static native void setvoice (INT gender, int age ); <br/> static native void setrate (INT value); <br/> static native int setwordgap (INT value); <br/> static native int setcapitals (INT value ); <br/> static native void setvolume (INT value); <br/> static native void setpitch (INT value); <br/> static native string [] listvoicenames (); <br/> static native void setvoicebyname (string voicename); <br/> static native void cancel (); <br/> static native Boolean isplaying (); <br/> static native void synchronize (); <br/> static native void terminate (); <br/> static native string Info ();

The basic example of jtts is as follows:

Jtts = engine. gettts (); <br/> jtts. setlanguage ("ZH"); <br/> jtts. speak. "); <Br/> jtts. Synchronize (); <br/> jtts. Speak. ");

The following is an example based on jtts:

 

: Http://greenvm.googlecode.com/files/JTTSEngine.7z
(

Contains examples and source code. Currently, only DLL encapsulation is provided.

)

------------

Okay, I admit that I want to write a reading tool for those who want to read novels but cannot read the full text ...... Now it's just the beginning ......

 

 

 

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.