public class SpeakConfig
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
LANGUAGE_ID_EN_US
speak in English
|
static int |
LANGUAGE_ID_ZH_TW
speak in Taiwanese Mandarin
|
static int |
READ_MODE_CHAR
sentence is read character by character
|
static int |
READ_MODE_SENTENCE
sentence is read normally.
|
static int |
READ_MODE_WORD
sentence is read word by word
|
Constructor and Description |
---|
SpeakConfig()
Create an SpeakConfig object
|
Modifier and Type | Method and Description |
---|---|
SpeakConfig |
context(java.lang.String context)
Set the listen domain and context
|
SpeakConfig |
domain(java.lang.String domain)
Set the listen domain and context
|
SpeakConfig |
domainList(org.json.JSONArray domainList)
Set the listen domain list
|
SpeakConfig |
languageId(int languageId)
Set the speech locale
|
SpeakConfig |
pitch(int pitch)
Set speech pitch
|
SpeakConfig |
readMode(int readMode)
Set the speaking style
|
SpeakConfig |
retry(int retry)
Set the listen retry
|
SpeakConfig |
speed(int speed)
Set speech speed
|
SpeakConfig |
timeout(float timeout)
Set the listen timeout
|
SpeakConfig |
volume(int volume)
Set speech volume
|
SpeakConfig |
waitFactor(int waitFactor)
Set the speech delay
|
public static final int LANGUAGE_ID_EN_US
public static final int LANGUAGE_ID_ZH_TW
public static final int READ_MODE_CHAR
public static final int READ_MODE_SENTENCE
public static final int READ_MODE_WORD
public SpeakConfig context(java.lang.String context)
context
- listening the specific domain and context. It is the pair of domain.public SpeakConfig domain(java.lang.String domain)
domain
- listening the specific domain and context. It is the pair of contextpublic SpeakConfig domainList(org.json.JSONArray domainList)
domainList
- listening the specific domains. If you set it and domain/context, this setting will skip.public SpeakConfig languageId(int languageId)
languageId
- language ID, currently it has only two values:
LANGUAGE_ID_ZH_TW and LANGUAGE_ID_EN_US.
The value will be changed when system locale is changed.public SpeakConfig pitch(int pitch)
pitch
- value in the range of [50, 200], default value is 100,
50 means one octave lower, 200 means one octave higher, default value is 100public SpeakConfig readMode(int readMode)
readMode
- the reading mode of TTSpublic SpeakConfig retry(int retry)
retry
- retry times if Zenbo doesn't understand.public SpeakConfig speed(int speed)
speed
- value in the range of [50, 400], default value is 100,
50 means 2x lower, 400 means 4x faster, default value is 100public SpeakConfig timeout(float timeout)
timeout
- timeout for listening. Unit is second.public SpeakConfig volume(int volume)
volume
- value in the range of [0, 100], default value is 80,
70 means 3dB lower, 100 means 6db higher, default value is 80public SpeakConfig waitFactor(int waitFactor)
waitFactor
- value in the range of [0, 9], default value is 1,
the delay between each sentences will be 200ms multiplied by that value