public final class SynthesisRequest
extends Object
| java.lang.Object | |
| android.speech.tts.SynthesisRequest | |
包含引擎合成语音所需的数据。 这些数据是:
setLanguage(Locale) instead of setVoice(Voice)params argument in
speak(CharSequence, int, Bundle, String) and
synthesizeToFile(CharSequence, Bundle, File, String).
Public constructors |
|
|---|---|
SynthesisRequest(String text, Bundle params) |
|
SynthesisRequest(CharSequence text, Bundle params) |
|
公共方法(Public methods) |
|
|---|---|
int |
getCallerUid() 获取请求调用者Uid。 |
CharSequence |
getCharSequenceText() 获取应该合成的文本。 |
String |
getCountry() 获取要使用的语言的ISO 3字母国家代码。 |
String |
getLanguage() 获取要使用的语言的ISO 3字母语言代码。 |
Bundle |
getParams() 获取额外的参数,如果有的话。 |
int |
getPitch() 获取使用的音高。 |
int |
getSpeechRate() 获取要使用的语速。 |
String |
getText() 此方法在API级别21中已弃用。从API级别21开始,替换为 |
String |
getVariant() 获取要使用的语言变体。 |
String |
getVoiceName() 获取要使用的语音的名称。 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
SynthesisRequest (String text, Bundle params)
| 参数(Parameters) | |
|---|---|
text |
String
|
params |
Bundle
|
SynthesisRequest (CharSequence text, Bundle params)
| 参数(Parameters) | |
|---|---|
text |
CharSequence
|
params |
Bundle
|
CharSequence getCharSequenceText ()
获取应该合成的文本。
| 返回(Returns) | |
|---|---|
CharSequence |
|
String getText ()
此方法在API级别21中已弃用。
从API级别21开始,替换为getCharSequenceText() 。
获取应该合成的文本。
| 返回(Returns) | |
|---|---|
String |
|