mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-02 22:07:12 +00:00
TtsService: use the same default..max value clamp for speech rate as when upgrading the settings
This commit is contained in:
@@ -213,7 +213,12 @@ public class TtsService extends TextToSpeechService {
|
||||
int rate = getPreferenceValue(prefs, "espeak_rate", Integer.MIN_VALUE);
|
||||
if (rate == Integer.MIN_VALUE) {
|
||||
// Try the old eyes-free setting:
|
||||
rate = (getPreferenceValue(prefs, "default_rate", 100) / 100) * mEngine.Rate.getDefaultValue();
|
||||
int defaultValue = mEngine.Rate.getDefaultValue();
|
||||
int maxValue = mEngine.Rate.getMaxValue();
|
||||
|
||||
rate = (getPreferenceValue(prefs, "default_rate", 100) / 100) * defaultValue;
|
||||
if (rate < defaultValue) rate = defaultValue;
|
||||
if (rate > maxValue) rate = maxValue;
|
||||
}
|
||||
|
||||
int pitch = getPreferenceValue(prefs, "espeak_pitch", Integer.MIN_VALUE);
|
||||
|
||||
Reference in New Issue
Block a user