public class ExpressionConfig
extends java.lang.Object
Example:
ExpressionConfig config = new ExpressionConfig();
config.volume(60).languageId(DialogSystem.LANGUAGE_ID_EN_US);
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 |
---|
ExpressionConfig()
Create an ExpressionConfig object
|
Modifier and Type | Method and Description |
---|---|
ExpressionConfig |
languageId(int languageId)
Set the speech locale
|
ExpressionConfig |
pitch(int pitch)
Set speech pitch
|
ExpressionConfig |
readMode(int readMode)
Set the speaking style
|
ExpressionConfig |
speed(int speed)
Set speech speed
|
ExpressionConfig |
volume(int volume)
Set speech volume
|
ExpressionConfig |
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 ExpressionConfig 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 ExpressionConfig 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 ExpressionConfig readMode(int readMode)
readMode
- the reading mode of TTSpublic ExpressionConfig 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 ExpressionConfig 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 ExpressionConfig 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