mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-03 14:17:12 +00:00
Expose the Punctuation Level setting.
This commit is contained in:
@@ -30,6 +30,7 @@ public class VoiceSettings {
|
||||
public static final String PREF_PITCH = "espeak_pitch";
|
||||
public static final String PREF_PITCH_RANGE = "espeak_pitch_range";
|
||||
public static final String PREF_VOLUME = "espeak_volume";
|
||||
public static final String PREF_PUNCTUATION_LEVEL = "espeak_punctuation_level";
|
||||
|
||||
public VoiceSettings(SharedPreferences preferences, SpeechSynthesis engine) {
|
||||
mPreferences = preferences;
|
||||
@@ -96,6 +97,16 @@ public class VoiceSettings {
|
||||
return range;
|
||||
}
|
||||
|
||||
public int getPunctuationLevel() {
|
||||
int min = mEngine.Punctuation.getMinValue();
|
||||
int max = mEngine.Punctuation.getMaxValue();
|
||||
|
||||
int level = getPreferenceValue(PREF_PUNCTUATION_LEVEL, mEngine.Punctuation.getDefaultValue());
|
||||
if (level > max) level = max;
|
||||
if (level < min) level = min;
|
||||
return level;
|
||||
}
|
||||
|
||||
private int getPreferenceValue(String preference, int defaultValue) {
|
||||
String prefString = mPreferences.getString(preference, null);
|
||||
if (prefString == null) {
|
||||
|
||||
Reference in New Issue
Block a user