Browse Source

SpeechSynthesis.java: rename the parameter APIs.

master
Reece H. Dunn 12 years ago
parent
commit
85836eae92
1 changed files with 14 additions and 14 deletions
  1. 14
    14
      android/src/com/reecedunn/espeak/SpeechSynthesis.java

+ 14
- 14
android/src/com/reecedunn/espeak/SpeechSynthesis.java View File

/** Announce some of the punctuation characters. */ /** Announce some of the punctuation characters. */
public static int PUNCT_SOME = 2; public static int PUNCT_SOME = 2;


public enum ParameterType {
public enum Parameter {
/** Speech rate in words per minute (80 - 450). */ /** Speech rate in words per minute (80 - 450). */
Rate(1), Rate(1),
/** Audio volume in percent (0 - 200; normal = 100). */ /** Audio volume in percent (0 - 200; normal = 100). */
/** Which punctuation characters to announce; see the PUNCT_* constants. */ /** Which punctuation characters to announce; see the PUNCT_* constants. */
Punctuation(5); Punctuation(5);


private int value;
private int id;


private ParameterType(int value) {
this.value = value;
private Parameter(int id) {
this.id = id;
} }


public int getValue() {
return value;
public int getId() {
return id;
} }
} }


public void setParameterValue(ParameterType parameter, int value, int scale) {
setParameterValue(parameter, (value * scale) / 100);
public void setValue(Parameter parameter, int value, int scale) {
setValue(parameter, (value * scale) / 100);
} }


public void setParameterValue(ParameterType parameter, int value) {
nativeSetParameter(parameter.getValue(), value);
public void setValue(Parameter parameter, int value) {
nativeSetParameter(parameter.getId(), value);
} }


public int getParameterValue(ParameterType parameter) {
return nativeGetParameter(parameter.getValue(), 1);
public int getValue(Parameter parameter) {
return nativeGetParameter(parameter.getId(), 1);
} }


public int getParameterDefaultValue(ParameterType parameter) {
return nativeGetParameter(parameter.getValue(), 0);
public int getDefaultValue(Parameter parameter) {
return nativeGetParameter(parameter.getId(), 0);
} }


public void synthesize(String text, boolean isSsml) { public void synthesize(String text, boolean isSsml) {

Loading…
Cancel
Save