diff options
Diffstat (limited to 'unbundle/java/com/android/tv/settings/unbundle/sdklib/TextToSpeechCompat.java')
-rw-r--r-- | unbundle/java/com/android/tv/settings/unbundle/sdklib/TextToSpeechCompat.java | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/unbundle/java/com/android/tv/settings/unbundle/sdklib/TextToSpeechCompat.java b/unbundle/java/com/android/tv/settings/unbundle/sdklib/TextToSpeechCompat.java new file mode 100644 index 000000000..abed4bfa8 --- /dev/null +++ b/unbundle/java/com/android/tv/settings/unbundle/sdklib/TextToSpeechCompat.java @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import android.speech.tts.TextToSpeech; + +public class TextToSpeechCompat { + public TextToSpeechCompat(TextToSpeech textToSpeech) { + mTextToSpeech = textToSpeech; + } + + private final TextToSpeech mTextToSpeech; + + public static class Engine { + public static final int DEFAULT_RATE = 100; + + public TextToSpeech.Engine mEngine; + + public Engine(TextToSpeech.Engine engine) { + mEngine = engine; + } + } + + public static class EngineInfo { + public EngineInfo(TextToSpeech.EngineInfo engineInfo) { + mEngineInfo = engineInfo; + this.mSystem = engineInfo.system; + } + + public TextToSpeech.EngineInfo mEngineInfo; + + public boolean mSystem; + } + + public String getCurrentEngine() { + return this.mTextToSpeech.getCurrentEngine(); + } +} |