mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-04 14:33:31 +00:00
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:
@@ -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"));
|
||||
|
||||
Reference in New Issue
Block a user