Saturday, December 1, 2012

android tts develop log

android text to voice doc:

public class
TextToSpeech
extends Object
java.lang.Object
↳ android.speech.tts.TextToSpeech
Class Overview
Synthesizes speech from text for immediate playback or to create a sound file.

A TextToSpeech instance can only be used to synthesize text once it has completed its initialization. Implement the TextToSpeech.OnInitListener to be notified of the completion of the initialization.
When you are done using the TextToSpeech instance, call the shutdown() method to release the native resources used by the TextToSpeech engine.

Summary
Nested Classes
class TextToSpeech.Engine Constants and parameter names for controlling text-to-speech.
class TextToSpeech.EngineInfo Information about an installed text-to-speech engine.
interface TextToSpeech.OnInitListener Interface definition of a callback to be invoked indicating the completion of the TextToSpeech engine initialization.
interface TextToSpeech.OnUtteranceCompletedListener Listener that will be called when the TTS service has completed synthesizing an utterance.
Constants
String ACTION_TTS_QUEUE_PROCESSING_COMPLETED Broadcast Action: The TextToSpeech synthesizer has completed processing of all the text in the speech queue.
int ERROR Denotes a generic operation failure.
int LANG_AVAILABLE Denotes the language is available for the language by the locale, but not the country and variant.
int LANG_COUNTRY_AVAILABLE Denotes the language is available for the language and country specified by the locale, but not the variant.
int LANG_COUNTRY_VAR_AVAILABLE Denotes the language is available exactly as specified by the locale.
int LANG_MISSING_DATA Denotes the language data is missing.
int LANG_NOT_SUPPORTED Denotes the language is not supported.
int QUEUE_ADD Queue mode where the new entry is added at the end of the playback queue.
int QUEUE_FLUSH Queue mode where all entries in the playback queue (media to be played and text to be synthesized) are dropped and replaced by the new entry.
int SUCCESS Denotes a successful operation.
Public Constructors
TextToSpeech(Context context, TextToSpeech.OnInitListener listener)
The constructor for the TextToSpeech class, using the default TTS engine.
TextToSpeech(Context context, TextToSpeech.OnInitListener listener, String engine)
The constructor for the TextToSpeech class, using the given TTS engine.
Public Methods
int addEarcon(String earcon, String filename)
Adds a mapping between a string of text and a sound file.
int addEarcon(String earcon, String packagename, int resourceId)
Adds a mapping between a string of text and a sound resource in a package.
int addSpeech(String text, String packagename, int resourceId)
Adds a mapping between a string of text and a sound resource in a package.
int addSpeech(String text, String filename)
Adds a mapping between a string of text and a sound file.
boolean areDefaultsEnforced()
Checks whether the user's settings should override settings requested by the calling application.
String getDefaultEngine()
Gets the package name of the default speech synthesis engine.
List<TextToSpeech.EngineInfo> getEngines()
Gets a list of all installed TTS engines.
Set<String> getFeatures(Locale locale)
Queries the engine for the set of features it supports for a given locale.
Locale getLanguage()
Returns a Locale instance describing the language currently being used by the TextToSpeech engine.
int isLanguageAvailable(Locale loc)
Checks if the specified language as represented by the Locale is available and supported.
boolean isSpeaking()
Checks whether the TTS engine is busy speaking.
int playEarcon(String earcon, int queueMode, HashMap<String, String> params)
Plays the earcon using the specified queueing mode and parameters.
int playSilence(long durationInMs, int queueMode, HashMap<String, String> params)
Plays silence for the specified amount of time using the specified queue mode.
int setEngineByPackageName(String enginePackageName)
This method is deprecated. This doesn'
t inform callers when the TTS engine has been initialized. TextToSpeech(Context, OnInitListener, String) can be used with the appropriate engine name. Also, there is no guarantee that the engine specified will be loaded. If it isn't installed or disabled, the user / system wide defaults will apply.
int setLanguage(Locale loc)
Sets the text-to-speech language.
int setOnUtteranceCompletedListener(TextToSpeech.OnUtteranceCompletedListener listener)
This method is deprecated. Use setOnUtteranceProgressListener(UtteranceProgressListener) instead.
int setOnUtteranceProgressListener(UtteranceProgressListener listener)
Sets the listener that will be notified of various events related to the synthesis of a given utterance.
int setPitch(float pitch)
Sets the speech pitch for the TextToSpeech engine.
int setSpeechRate(float speechRate)
Sets the speech rate.
void shutdown()
Releases the resources used by the TextToSpeech engine.
int speak(String text, int queueMode, HashMap<String, String> params)
Speaks the string using the specified queuing strategy and speech parameters.
int stop()
Interrupts the current utterance (whether played or rendered to file) and discards other utterances in the queue.
int synthesizeToFile(String text, HashMap<String, String> params, String filename)
Synthesizes the given text to a file using the specified parameters.
[Collapse]
Inherited Methods
From class java.lang.Object
Object clone()
Creates and returns a copy of this Object.
boolean equals(Object o)
Compares this instance with the specified object and indicates if they are equal.
void finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
final Class<?> getClass()
Returns the unique instance of Class that represents this object'
s class.
int hashCode()
Returns an integer hash code for this object.
final void notify()
Causes a thread which is waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.
final void notifyAll()
Causes all threads which are waiting on this object'
s monitor (by means of calling one of the wait() methods) to be woken up.
String toString()
Returns a string containing a concise, human-readable description of this object.
final void wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
final void wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.
final void wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.
Constants
public static final String ACTION_TTS_QUEUE_PROCESSING_COMPLETED

Since: API Level 4
Broadcast Action: The TextToSpeech synthesizer has completed processing of all the text in the speech queue. Note that this notifies callers when the engine has finished has processing text data. Audio playback might not have completed (or even started) at this point. If you wish to be notified when this happens, see TextToSpeech.OnUtteranceCompletedListener.

Constant Value: "android.speech.tts.TTS_QUEUE_PROCESSING_COMPLETED"
public static final int ERROR

Since: API Level 4
Denotes a generic operation failure.

Constant Value: -1 (0xffffffff)
public static final int LANG_AVAILABLE

Since: API Level 4
Denotes the language is available for the language by the locale, but not the country and variant.

Constant Value: 0 (0x00000000)
public static final int LANG_COUNTRY_AVAILABLE

Since: API Level 4
Denotes the language is available for the language and country specified by the locale, but not the variant.

Constant Value: 1 (0x00000001)
public static final int LANG_COUNTRY_VAR_AVAILABLE

Since: API Level 4
Denotes the language is available exactly as specified by the locale.

Constant Value: 2 (0x00000002)
public static final int LANG_MISSING_DATA

Since: API Level 4
Denotes the language data is missing.

Constant Value: -1 (0xffffffff)
public static final int LANG_NOT_SUPPORTED

Since: API Level 4
Denotes the language is not supported.

Constant Value: -2 (0xfffffffe)
public static final int QUEUE_ADD

Since: API Level 4
Queue mode where the new entry is added at the end of the playback queue.

Constant Value: 1 (0x00000001)
public static final int QUEUE_FLUSH

Since: API Level 4
Queue mode where all entries in the playback queue (media to be played and text to be synthesized) are dropped and replaced by the new entry. Queues are flushed with respect to a given calling app. Entries in the queue from other callees are not discarded.

Constant Value: 0 (0x00000000)
public static final int SUCCESS

Since: API Level 4
Denotes a successful operation.

Constant Value: 0 (0x00000000)
Public Constructors
public TextToSpeech (Context context, TextToSpeech.OnInitListener listener)

Since: API Level 4
The constructor for the TextToSpeech class, using the default TTS engine. This will also initialize the associated TextToSpeech engine if it isn't already running.

Parameters
context The context this instance is running in.
listener The TextToSpeech.OnInitListener that will be called when the TextToSpeech engine has initialized.
public TextToSpeech (Context context, TextToSpeech.OnInitListener listener, String engine)

Since: API Level 14
The constructor for the TextToSpeech class, using the given TTS engine. This will also initialize the associated TextToSpeech engine if it isn'
t already running.

Parameters
context The context this instance is running in.
listener The TextToSpeech.OnInitListener that will be called when the TextToSpeech engine has initialized.
engine Package name of the TTS engine to use.
Public Methods
public int addEarcon (String earcon, String filename)

Since: API Level 4
Adds a mapping between a string of text and a sound file. Use this to add custom earcons.

Parameters
earcon The name of the earcon. Example: "[tick]"
filename The full path to the sound file (for example: "/sdcard/mysounds/tick.wav")
Returns
Code indicating success or failure. See ERROR and SUCCESS.
See Also
playEarcon(String, int, HashMap)
public int addEarcon (String earcon, String packagename, int resourceId)

Since: API Level 4
Adds a mapping between a string of text and a sound resource in a package. Use this to add custom earcons.

Parameters
earcon The name of the earcon. Example: "[tick]"
packagename the package name of the application that contains the resource. This can for instance be the package name of your own application. Example: "com.google.marvin.compass"
The package name can be found in the AndroidManifest.xml of the application containing the resource.
<manifest xmlns:android="..." package="com.google.marvin.compass">

resourceId Example: R.raw.tick_snd
Returns
Code indicating success or failure. See ERROR and SUCCESS.
See Also
playEarcon(String, int, HashMap)
public int addSpeech (String text, String packagename, int resourceId)

Since: API Level 4
Adds a mapping between a string of text and a sound resource in a package. After a call to this method, subsequent calls to speak(String, int, HashMap) will play the specified sound resource if it is available, or synthesize the text it is missing.

Parameters
text The string of text. Example: "south_south_east"
packagename Pass the packagename of the application that contains the resource. If the resource is in your own application (this is the most common case), then put the packagename of your application here.
Example: "com.google.marvin.compass"
The packagename can be found in the AndroidManifest.xml of your application.
<manifest xmlns:android="..." package="com.google.marvin.compass">

resourceId Example: R.raw.south_south_east
Returns
Code indicating success or failure. See ERROR and SUCCESS.
public int addSpeech (String text, String filename)

Since: API Level 4
Adds a mapping between a string of text and a sound file. Using this, it is possible to add custom pronounciations for a string of text. After a call to this method, subsequent calls to speak(String, int, HashMap) will play the specified sound resource if it is available, or synthesize the text it is missing.

Parameters
text The string of text. Example: "south_south_east"
filename The full path to the sound file (for example: "/sdcard/mysounds/hello.wav")
Returns
Code indicating success or failure. See ERROR and SUCCESS.
public boolean areDefaultsEnforced ()

Since: API Level 8
Checks whether the user's settings should override settings requested by the calling application. As of the Ice cream sandwich release, user settings never forcibly override the app's settings.

public String getDefaultEngine ()

Since: API Level 8
Gets the package name of the default speech synthesis engine.

Returns
Package name of the TTS engine that the user has chosen as their default.
public List<TextToSpeech.EngineInfo> getEngines ()

Since: API Level 14
Gets a list of all installed TTS engines.

Returns
A list of engine info objects. The list can be empty, but never null.
public Set<String> getFeatures (Locale locale)

Since: API Level 15
Queries the engine for the set of features it supports for a given locale. Features can either be framework defined, e.g. KEY_FEATURE_NETWORK_SYNTHESIS or engine specific. Engine specific keys must be prefixed by the name of the engine they are intended for. These keys can be used as parameters to speak(String, int, java.util.HashMap) and synthesizeToFile(String, java.util.HashMap, String). Features are boolean flags, and their values in the synthesis parameters must be behave as per parseBoolean(String).

Parameters
locale The locale to query features for.
public Locale getLanguage ()

Since: API Level 4
Returns a Locale instance describing the language currently being used by the TextToSpeech engine.

Returns
language, country (if any) and variant (if any) used by the engine stored in a Locale instance, or null on error.
public int isLanguageAvailable (Locale loc)

Since: API Level 4
Checks if the specified language as represented by the Locale is available and supported.

Parameters
loc The Locale describing the language to be used.
Returns
Code indicating the support status for the locale. See LANG_AVAILABLE, LANG_COUNTRY_AVAILABLE, LANG_COUNTRY_VAR_AVAILABLE, LANG_MISSING_DATA and LANG_NOT_SUPPORTED.
public boolean isSpeaking ()

Since: API Level 4
Checks whether the TTS engine is busy speaking. Note that a speech item is considered complete once it's audio data has been sent to the audio mixer, or written to a file. There might be a finite lag between this point, and when the audio hardware completes playback.

Returns
true if the TTS engine is speaking.
public int playEarcon (String earcon, int queueMode, HashMap<String, String> params)

Since: API Level 4
Plays the earcon using the specified queueing mode and parameters. The earcon must already have been added with addEarcon(String, String) or addEarcon(String, String, int).

Parameters
earcon The earcon that should be played
queueMode QUEUE_ADD or QUEUE_FLUSH.
params Parameters for the request. Can be null. Supported parameter names: KEY_PARAM_STREAM, KEY_PARAM_UTTERANCE_ID. Engine specific parameters may be passed in but the parameter keys must be prefixed by the name of the engine they are intended for. For example the keys "com.svox.pico_foo" and "com.svox.pico:bar" will be passed to the engine named "com.svox.pico" if it is being used.
Returns
ERROR or SUCCESS.
public int playSilence (long durationInMs, int queueMode, HashMap<String, String> params)

Since: API Level 4
Plays silence for the specified amount of time using the specified queue mode.

Parameters
durationInMs The duration of the silence.
queueMode QUEUE_ADD or QUEUE_FLUSH.
params Parameters for the request. Can be null. Supported parameter names: KEY_PARAM_UTTERANCE_ID. Engine specific parameters may be passed in but the parameter keys must be prefixed by the name of the engine they are intended for. For example the keys "com.svox.pico_foo" and "com.svox.pico:bar" will be passed to the engine named "com.svox.pico" if it is being used.
Returns
ERROR or SUCCESS.
public int setEngineByPackageName (String enginePackageName)

Since: API Level 8
This method is deprecated.
This doesn'
t inform callers when the TTS engine has been initialized. TextToSpeech(Context, OnInitListener, String) can be used with the appropriate engine name. Also, there is no guarantee that the engine specified will be loaded. If it isn't installed or disabled, the user / system wide defaults will apply.

Sets the TTS engine to use.

Parameters
enginePackageName The package name for the synthesis engine (e.g. "com.svox.pico")
Returns
ERROR or SUCCESS.
public int setLanguage (Locale loc)

Since: API Level 4
Sets the text-to-speech language. The TTS engine will try to use the closest match to the specified language as represented by the Locale, but there is no guarantee that the exact same Locale will be used. Use isLanguageAvailable(Locale) to check the level of support before choosing the language to use for the next utterances.

Parameters
loc The locale describing the language to be used.
Returns
Code indicating the support status for the locale. See LANG_AVAILABLE, LANG_COUNTRY_AVAILABLE, LANG_COUNTRY_VAR_AVAILABLE, LANG_MISSING_DATA and LANG_NOT_SUPPORTED.
public int setOnUtteranceCompletedListener (TextToSpeech.OnUtteranceCompletedListener listener)

Since: API Level 4
This method is deprecated.
Use setOnUtteranceProgressListener(UtteranceProgressListener) instead.

Sets the listener that will be notified when synthesis of an utterance completes.

Parameters
listener The listener to use.
Returns
ERROR or SUCCESS.
public int setOnUtteranceProgressListener (UtteranceProgressListener listener)

Since: API Level 15
Sets the listener that will be notified of various events related to the synthesis of a given utterance. See UtteranceProgressListener and KEY_PARAM_UTTERANCE_ID.

Parameters
listener the listener to use.
Returns
ERROR or SUCCESS
public int setPitch (float pitch)

Since: API Level 4
Sets the speech pitch for the TextToSpeech engine. This has no effect on any pre-recorded speech.

Parameters
pitch Speech pitch. 1.0 is the normal pitch, lower values lower the tone of the synthesized voice, greater values increase it.
Returns
ERROR or SUCCESS.
public int setSpeechRate (float speechRate)

Since: API Level 4
Sets the speech rate. This has no effect on any pre-recorded speech.

Parameters
speechRate Speech rate. 1.0 is the normal speech rate, lower values slow down the speech (0.5 is half the normal speech rate), greater values accelerate it (2.0 is twice the normal speech rate).
Returns
ERROR or SUCCESS.
public void shutdown ()

Since: API Level 4
Releases the resources used by the TextToSpeech engine. It is good practice for instance to call this method in the onDestroy() method of an Activity so the TextToSpeech engine can be cleanly stopped.

public int speak (String text, int queueMode, HashMap<String, String> params)

Since: API Level 4
Speaks the string using the specified queuing strategy and speech parameters.

Parameters
text The string of text to be spoken.
queueMode The queuing strategy to use, QUEUE_ADD or QUEUE_FLUSH.
params Parameters for the request. Can be null. Supported parameter names: KEY_PARAM_STREAM, KEY_PARAM_UTTERANCE_ID, KEY_PARAM_VOLUME, KEY_PARAM_PAN. Engine specific parameters may be passed in but the parameter keys must be prefixed by the name of the engine they are intended for. For example the keys "com.svox.pico_foo" and "com.svox.pico:bar" will be passed to the engine named "com.svox.pico" if it is being used.
Returns
ERROR or SUCCESS.
public int stop ()

Since: API Level 4
Interrupts the current utterance (whether played or rendered to file) and discards other utterances in the queue.

Returns
ERROR or SUCCESS.
public int synthesizeToFile (String text, HashMap<String, String> params, String filename)

Since: API Level 4
Synthesizes the given text to a file using the specified parameters.

Parameters
text The text that should be synthesized
params Parameters for the request. Can be null. Supported parameter names: KEY_PARAM_UTTERANCE_ID. Engine specific parameters may be passed in but the parameter keys must be prefixed by the name of the engine they are intended for. For example the keys "com.svox.pico_foo" and "com.svox.pico:bar" will be passed to the engine named "com.svox.pico" if it is being used.
filename Absolute file filename to write the generated audio data to.It should be something like "/sdcard/myappsounds/mysound.wav".
Returns
ERROR or SUCCESS.
Except as noted, this content is licensed under Apache 2.0. For details and restrictions, see the Content License.
Android 4.1 r1 - 11 Jul 2012 1:54
About Android | Legal | Support

this is also in your android install path:

file:///E:/Program%20Files/Android/android-sdk/docs/reference/android/speech/tts/TextToSpeech.html





 


android 2.3 engine locale list:

Language / Locale                 Supported since version

English, US (en_US) 1.1
German, Germany (de_DE) 1.1
Chinese, PRC (zh_CN) 1.5
Chinese, Taiwan (zh_TW) 1.5
Czech, Czech Republic (cs_CZ) 1.5
Dutch, Belgium (nl_BE) 1.5
Dutch, Netherlands (nl_NL) 1.5
English, Australia (en_AU) 1.5
English, Britain (en_GB) 1.5
English, Canada (en_CA) 1.5
English, New Zealand (en_NZ) 1.5
English, Singapore(en_SG) 1.5
French, Belgium (fr_BE) 1.5
French, Canada (fr_CA) 1.5
French, France (fr_FR) 1.5
French, Switzerland (fr_CH) 1.5
German, Austria (de_AT) 1.5
German, Liechtenstein (de_LI) 1.5
German, Switzerland (de_CH) 1.5
Italian, Italy (it_IT) 1.5
Italian, Switzerland (it_CH) 1.5
Japanese (ja_JP) 1.5
Korean (ko_KR) 1.5
Polish (pl_PL) 1.5
Russian (ru_RU) 1.5
Spanish (es_ES) 1.5
Arabic, Egypt (ar_EG) 2.3
Arabic, Israel (ar_IL) 2.3
Bulgarian, Bulgaria (bg_BG) 2.3
Catalan, Spain (ca_ES) 2.3
Croatian, Croatia (hr_HR) 2.3
Danish, Denmark(da_DK) 2.3
English, India (en_IN) 2.3
English, Ireland (en_IE) 2.3
English, Zimbabwe (en_ZA) 2.3
Finnish, Finland (fi_FI) 2.3
Greek, Greece (el_GR) 2.3
Hebrew, Israel (iw_IL)* 2.3
Hindi, India (hi_IN) 2.3
Hungarian, Hungary (hu_HU) 2.3
Indonesian, Indonesia (in_ID)* 2.3
Latvian, Latvia (lv_LV) 2.3
Lithuanian, Lithuania (lt_LT) 2.3
Norwegian-Bokmol, Norway(nb_NO) 2.3
Portuguese, Brazil (pt_BR) 2.3
Portuguese, Portugal (pt_PT) 2.3
Romanian, Romania (ro_RO) 2.3
Serbian (sr_RS) 2.3
Slovak, Slovakia (sk_SK) 2.3
Slovenian, Slovenia (sl_SI) 2.3
Spanish, US (es_US) 2.3
Swedish, Sweden (sv_SE) 2.3
Tagalog, Philippines (tl_PH) 2.3
Thai, Thailand (th_TH) 2.3
Turkish, Turkey (tr_TR) 2.3
Ukrainian, Ukraine (uk_UA) 2.3
Vietnamese, Vietnam (vi_VN) 2.3

4.0.3 tts engine list:

Arabic, Egypt (ar_EG)
Arabic, Israel (ar_IL)
Bulgarian, Bulgaria (bg_BG)
Catalan, Spain (ca_ES)
Czech, Czech Republic (cs_CZ)
Danish, Denmark(da_DK)
German, Austria (de_AT)
German, Switzerland (de_CH)
German, Germany (de_DE)
German, Liechtenstein (de_LI)
Greek, Greece (el_GR)
English, Australia (en_AU)
English, Canada (en_CA)
English, Britain (en_GB)
English, Ireland (en_IE)
English, India (en_IN)
English, New Zealand (en_NZ)
English, Singapore(en_SG)
English, US (en_US)
English, South Africa (en_ZA)
Spanish (es_ES)
Spanish, US (es_US)
Finnish, Finland (fi_FI)
French, Belgium (fr_BE)
French, Canada (fr_CA)
French, Switzerland (fr_CH)
French, France (fr_FR)
Hebrew, Israel (he_IL)
Hindi, India (hi_IN)
Croatian, Croatia (hr_HR)
Hungarian, Hungary (hu_HU)
Indonesian, Indonesia (id_ID)
Italian, Switzerland (it_CH)
Italian, Italy (it_IT)
Japanese (ja_JP)
Korean (ko_KR)
Lithuanian, Lithuania (lt_LT)
Latvian, Latvia (lv_LV)
Norwegian bokmål, Norway (nb_NO)
Dutch, Belgium (nl_BE)
Dutch, Netherlands (nl_NL)
Polish (pl_PL)
Portuguese, Brazil (pt_BR)
Portuguese, Portugal (pt_PT)
Romanian, Romania (ro_RO)
Russian (ru_RU)
Slovak, Slovakia (sk_SK)
Slovenian, Slovenia (sl_SI)
Serbian (sr_RS)
Swedish, Sweden (sv_SE)
Thai, Thailand (th_TH)
Tagalog, Philippines (tl_PH)
Turkish, Turkey (tr_TR)
Ukrainian, Ukraine (uk_UA)
Vietnamese, Vietnam (vi_VN)
Chinese, PRC (zh_CN)
Chinese, Taiwan (zh_TW)





android 2.3安装中文语音引擎.


1.点这里:

http://www.coolapk.com/apk/4526/




下载对应的主程序+离线语音包.


2. 修复系统的 设置 –> 语音输入与输出 选项.


我的是华为C8650+. android 2.3.6 系统自带操作系统.


先找了一个语音选项修复的应用,只看见广告有效,其它功能一律一点退出.


后找了”Vlingo虚拟助手”,也没有看见有该选项.


又装了"科大讯飞语音输入法",只看见输入法有它的选项,语音输入与输出还是没有见到.


高度了代码,朗读的TTS还是不运行中文语言.


又找了文档说,TextToSpeech.setEngineByPackageName(String engineName) 可以设置语言引擎,如果没有安装该引擎,系统会默认使用缺省的.


这是它的文档网址:http://cache.baidu.com/c?m=9f65cb4a8c8507ed4fece7631046893b4c4380146d96864968d4e414c422461a163cbde070724746899820301cfc091ab1a168252a5577f1c893d60bc0bf932d2e8b2d326459db0144dc4af39d06789a76875a98f445a1edac7484aea3959915&p=817fc307c5934eac58eec92d0216d621&newp=8b2a95448e8909ff57ee947d4c508a305c5bc4387ebad714788cd900&user=baidu&fm=sc&query=android+intent+tts&qid=c6efdc2402a9ed2b&p1=1


后面通过TextToSpeech.setEngineByPackageName("com.iflytek.tts") 这样也同上面一样.不能用.虽然这个函数返回值是0.


准备使用讯飞语音.不知道这支持不支持离线.


后来找到这句话:

缺少相应的程序模块,系统被精简了
在/system/app中加入以下系统文件:Picotts.apk,TtsService.apk,改权限为rw-r--r--重启即可



比如,我的手机是华为C8650+,去上网找相应的ROM,再弄出上面的文件到手机里.一会尝试.

No comments: