Please respect the results of other people's work, reproduced please specify the Source:"Android voice synthesis TTS" cloud-aware offline TTS use detailed
PS.
cloud-aware is 2012 1 years of development, but its voice recognition technology core team has been in business for more than more than 10 years, accumulated quite abundant, This is why it is possible to be able to do well in the field of speech recognition within a year. Micro-voice plug-in, Sogou voice assistant, le video super TV, Lao Luo Hammer operating system, touch the treasure Input method, there are NetEase + The telecom launched the easy letter, using the voice recognition of cloud-aware sound. 2013 years, the recognition of cloud-aware sound in the capital market is very high, very popular.
Current Cloud-aware sound provides free offline TTS , but API less, the function is relatively simple, synthetic voice is also more blunt, if the synthesis of voice requirements are not high, you can consider access.
Integration Method:
Import Cloud-aware sound TTS related Jar Packages and So file
for ease of use I'm here to make a further encapsulation of the Baidu speech synthesis engine, encapsulated as speechutiloffline  
Package Comjph.tts.usc;import Android.content.context;import Android.media.audiomanager;import android.util.Log; Import Cn.yunzhisheng.tts.offline.ttsplayerlistener;import Cn.yunzhisheng.tts.offline.basic.ittscontrol;import cn.yunzhisheng.tts.offline.basic.ttsfactory;/** * Offline Voice Resolution * * @author JPH * @date 2015-4-14 pm 7:20:25 */public class SPEEC Hutiloffline implements Ttsplayerlistener {public static final string appKey = "_appkey_";p ublic static final string SECR ET = "_secret_";p rivate ittscontrol mttsplayer;private Context context;public speechutiloffline (context context) { This.context = Context;init ();} /** * Init engine * @author JPH * @date 2015-4-14 pm 7:32:58 */private void init () {mttsplayer = Ttsfactory.createttscontrol (cont ext, AppKey);//Initialize Speech synthesis Object Mttsplayer.setttslistener (this);//Set Callback listener Mttsplayer.setstreamtype (AUDIOMANAGER.STREAM_ MUSIC);//Set the audio stream mttsplayer.setvoicespeed (2.5f);//Set the broadcast speed, broadcast speed, value range 0.1~2.5 default to 1.0mttsplayer.setvoicepitch (1.1f);// Set the broadcast pitch, adjust the pitch, value range 0.9~1.1 default to 1.0mTTSPlayer.Init ();//Initialize synthesis engine}/** * Stop play * @author JPH * @date 2015-4-14 pm 7:50:35 */public void Stop () {mttsplayer.stop ();} /** * Play * * @author JPH * @date 2015-4-14 pm 7:29:24 */public void Play (String content) {mttsplayer.play (content);} /** * Release Resources * * @author JPH * @date 2015-4-14 pm 7:27:56 */public void Release () {//Active release Offline engine Mttsplayer.release ();} @Overridepublic void Onplayend () {//Play complete callback log.i ("MSG", "Onplayend");} @Overridepublic void Onplaybegin () {//Start playback callback log.i ("MSG", "Onplaybegin");} @Overridepublic void Oninitfinish () {//Initialize successful callback log.i ("MSG", "Oninitfinish");} @Overridepublic void OnError (Cn.yunzhisheng.tts.offline.common.USCError arg0) {//Speech synthesis Error callback LOG.I ("MSG", "OnError");} @Overridepublic void OnCancel () {//cancels playback of callback log.i ("MSG", "OnCancel");} @Overridepublic void Onbuffer () {//Start buffer callback log.i ("MSG", "Onbuffer");}}
How to use:
Package Comjph.tts.usc;import Android.app.activity;import Android.os.bundle;import android.view.view;import Android.view.view.onclicklistener;import Android.widget.edittext;public class Ttsofflineactivity extends Activity Implements Onclicklistener {private EditText mttstext;private speechutiloffline offline; @Overridepublic void OnCreate ( Bundle savedinstancestate) {super.oncreate (savedinstancestate); Setcontentview (R.layout.activity_offline_tts); Mttstext = (EditText) Findviewbyid (r.id.textviewresult); offline=new Speechutiloffline (this);} @Overridepublic void OnClick (View v) {switch (V.getid ()) {Case R.id.btnplay:offline.play (Mttstext.gettext (). ToString ( ); Break;case r.id.btnstop:offline.stop (); break;default:break;}}
Demo.
http://download.csdn.net/detail/fengyuzhengfan/8595643
Recommended reading:
"Android speech TTS" domestic mainstream engine comparison
"Android voice synthesis TTS" Baidu Voice Access method, and the use of tips detailed
"Android Speech synthesis TTS" cloud-aware offline TTS using detailed