SpeechSynthesis.java: further simplify the setVoice method.

This renames `setVoiceByProperties` to the more consise `setVoice`
and removes the name parameter as this is not used -- the voice is
set by the language and gender parameters only.
This commit is contained in:
Reece H. Dunn
2013-05-02 16:45:46 +01:00
parent 027217d5f7
commit 88eab88d8a
3 changed files with 10 additions and 14 deletions
@@ -169,8 +169,8 @@ public class SpeechSynthesis {
return voices;
}
public void setVoiceByProperties(String name, String languages, int gender) {
nativeSetVoiceByProperties(name, languages, gender);
public void setVoice(String language, int gender) {
nativeSetVoice(language, gender);
}
public void setRate(int rate) {
@@ -300,7 +300,7 @@ public class SpeechSynthesis {
private native final String[] nativeGetAvailableVoices();
private native final boolean nativeSetVoiceByProperties(String name, String languages, int gender);
private native final boolean nativeSetVoice(String language, int gender);
private native final boolean nativeSetRate(int rate);
@@ -221,7 +221,7 @@ public class TtsService extends TextToSpeechService {
mCallback.start(mEngine.getSampleRate(), mEngine.getAudioFormat(),
mEngine.getChannelCount());
mEngine.setVoiceByProperties(null, mMatchingVoice.name, gender);
mEngine.setVoice(mMatchingVoice.name, gender);
mEngine.setRate(rate);
mEngine.setPitch(pitch);
mEngine.synthesize(text, text.startsWith("<speak"));