mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-03 22:26:48 +00:00
TtsService: fix and test onGetVoice.
The default Android 5.0 implementation enumerates the available locales. This enumerates the voices returned by eSpeak.
This commit is contained in:
@@ -41,6 +41,7 @@ import android.util.Log;
|
||||
|
||||
import com.reecedunn.espeak.SpeechSynthesis.SynthReadyCallback;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
@@ -205,7 +206,13 @@ public class TtsService extends TextToSpeechService {
|
||||
|
||||
@Override
|
||||
public List<android.speech.tts.Voice> onGetVoices() {
|
||||
return super.onGetVoices();
|
||||
List<android.speech.tts.Voice> voices = new ArrayList<android.speech.tts.Voice>();
|
||||
for (Voice voice : mAvailableVoices) {
|
||||
int quality = android.speech.tts.Voice.QUALITY_NORMAL;
|
||||
int latency = android.speech.tts.Voice.LATENCY_VERY_LOW;
|
||||
voices.add(new android.speech.tts.Voice(voice.name, voice.locale, quality, latency, false, null));
|
||||
}
|
||||
return voices;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user