Home
last modified time | relevance | path

Searched refs:TextToSpeech (Results 1 – 25 of 52) sorted by relevance

123

/aosp12/frameworks/base/core/java/android/speech/tts/
H A DPlaybackSynthesisCallback.java65 mStatusCode = TextToSpeech.SUCCESS; in PlaybackSynthesisCallback()
143 return TextToSpeech.ERROR; in start()
151 return TextToSpeech.ERROR; in start()
155 return TextToSpeech.ERROR; in start()
164 return TextToSpeech.SUCCESS; in start()
181 return TextToSpeech.ERROR; in audioAvailable()
185 return TextToSpeech.ERROR; in audioAvailable()
205 return TextToSpeech.ERROR; in audioAvailable()
210 return TextToSpeech.SUCCESS; in audioAvailable()
224 return TextToSpeech.ERROR; in done()
[all …]
H A DFileSynthesisCallback.java62 mStatusCode = TextToSpeech.SUCCESS; in FileSynthesisCallback()
124 return TextToSpeech.ERROR; in start()
128 return TextToSpeech.ERROR; in start()
148 return TextToSpeech.ERROR; in start()
166 return TextToSpeech.ERROR; in audioAvailable()
171 return TextToSpeech.ERROR; in audioAvailable()
175 return TextToSpeech.ERROR; in audioAvailable()
186 return TextToSpeech.SUCCESS; in audioAvailable()
193 return TextToSpeech.ERROR; in audioAvailable()
217 if (mStatusCode != TextToSpeech.SUCCESS && mStatusCode != TextToSpeech.STOPPED) { in done()
[all …]
H A DTextToSpeechService.java36 import android.speech.tts.TextToSpeech.Engine;
362 return TextToSpeech.ERROR; in onLoadVoice()
369 return TextToSpeech.ERROR; in onLoadVoice()
373 return TextToSpeech.SUCCESS; in onLoadVoice()
375 return TextToSpeech.ERROR; in onLoadVoice()
393 return TextToSpeech.ERROR; in onIsValidVoiceName()
400 return TextToSpeech.ERROR; in onIsValidVoiceName()
402 return TextToSpeech.SUCCESS; in onIsValidVoiceName()
404 return TextToSpeech.ERROR; in onIsValidVoiceName()
648 return TextToSpeech.SUCCESS; in stopForApp()
[all …]
/aosp12/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/tts/
H A DTtsPlaybackPreferenceControllerTest.java31 import android.speech.tts.TextToSpeech;
69 private static final TextToSpeech.EngineInfo ENGINE_INFO = new TextToSpeech.EngineInfo();
89 private TextToSpeech mTextToSpeech;
136 TextToSpeech.Engine.DEFAULT_RATE); in setUp()
138 TextToSpeech.Engine.DEFAULT_PITCH); in setUp()
153 TextToSpeech.Engine.ACTION_CHECK_TTS_DATA); in onCreate_startsCheckVoiceData()
180 TextToSpeech.Engine.CHECK_VOICE_DATA_PASS, data); in voiceDataCheck_processActivityResult_dataIsNotNull_updatesDefaultSynth()
214 TextToSpeech.LANG_AVAILABLE, /* data= */ null); in getSampleText_processActivityResult_dataIsNull_setsDefaultText()
228 TextToSpeech.LANG_AVAILABLE, data); in getSampleText_processActivityResult_emptyText_setsDefaultText()
242 TextToSpeech.LANG_AVAILABLE, data); in getSampleText_processActivityResult_dataIsNotNull_setsCorrectText()
[all …]
H A DTtsPlaybackSettingsManagerTest.java31 import android.speech.tts.TextToSpeech;
56 private TextToSpeech mTts;
68 TextToSpeech.Engine.DEFAULT_RATE); in setUp()
70 TextToSpeech.Engine.DEFAULT_PITCH); in setUp()
75 int newSpeechRate = TextToSpeech.Engine.DEFAULT_RATE + 40; in updateSpeechRate_updatesSetting()
84 int newSpeechRate = TextToSpeech.Engine.DEFAULT_RATE + 40; in updateSpeechRate_updatesTts()
91 int newSpeechRate = TextToSpeech.Engine.DEFAULT_RATE + 40; in getCurrentSpeechRate_returnsCorrectRate()
99 int newSpeechRate = TextToSpeech.Engine.DEFAULT_RATE + 40; in resetSpeechRate_setsToDefault()
105 TextToSpeech.Engine.DEFAULT_RATE); in resetSpeechRate_setsToDefault()
140 TextToSpeech.Engine.DEFAULT_PITCH); in resetVoicePitch_setsToDefault()
[all …]
H A DPreferredEngineOptionsPreferenceControllerTest.java28 import android.speech.tts.TextToSpeech;
57 private static final TextToSpeech.EngineInfo OTHER_ENGINE_INFO = new TextToSpeech.EngineInfo();
58 private static final TextToSpeech.EngineInfo CURRENT_ENGINE_INFO =
59 new TextToSpeech.EngineInfo();
80 private TextToSpeech mTextToSpeech;
174 mPreferenceController.onUpdateEngine(TextToSpeech.SUCCESS); in performClick_otherEngine_initSuccess_changeCurrentEngine()
190 mPreferenceController.onUpdateEngine(TextToSpeech.ERROR); in performClick_otherEngine_initFail_keepCurrentEngine()
210 TextToSpeech createTts(TextToSpeech.OnInitListener listener, String engine) { in createTts()
/aosp12/frameworks/base/tests/TtsTests/src/com/android/speech/tts/
H A DTextToSpeechTests.java21 import android.speech.tts.TextToSpeech;
43 private TextToSpeech mTts;
58 blockingInitAndVerify(MOCK_ENGINE, TextToSpeech.SUCCESS); in setUp()
128 Mockito.doReturn(TextToSpeech.LANG_NOT_SUPPORTED).when( in testSetLanguage_unavailableLanguage()
130 Mockito.doReturn(TextToSpeech.LANG_NOT_SUPPORTED).when( in testSetLanguage_unavailableLanguage()
150 Mockito.doReturn(TextToSpeech.LANG_COUNTRY_AVAILABLE).when( in testIsLanguageAvailable()
166 Mockito.doReturn(TextToSpeech.LANG_COUNTRY_AVAILABLE). in testDefaultLanguage_setsVoiceName()
171 Mockito.doReturn(TextToSpeech.LANG_COUNTRY_AVAILABLE). in testDefaultLanguage_setsVoiceName()
194 mTts.speak(speech, TextToSpeech.QUEUE_ADD, null); in blockingCallSpeak()
201 TextToSpeech.OnInitListener listener = Mockito.mock( in blockingInitAndVerify()
[all …]
H A DMockableCheckVoiceData.java22 import android.speech.tts.TextToSpeech;
41 setResult(TextToSpeech.Engine.CHECK_VOICE_DATA_FAIL, returnVal); in onCreate()
46 returnVal.putStringArrayListExtra(TextToSpeech.Engine.EXTRA_AVAILABLE_VOICES, in onCreate()
50 returnVal.putStringArrayListExtra(TextToSpeech.Engine.EXTRA_UNAVAILABLE_VOICES, in onCreate()
54 setResult(TextToSpeech.Engine.CHECK_VOICE_DATA_PASS, returnVal); in onCreate()
/aosp12/packages/apps/TvSettings/Settings/src/com/android/tv/settings/system/
H A DTextToSpeechFragment.java28 import android.speech.tts.TextToSpeech;
91 private int mDefaultRate = TextToSpeech.Engine.DEFAULT_RATE;
110 private TextToSpeech mTts = null;
132 private final TextToSpeech.OnInitListener mInitListener = new TextToSpeech.OnInitListener() {
144 private final TextToSpeech.OnInitListener mUpdateListener = new TextToSpeech.OnInitListener() {
232 mDefaultRate = TextToSpeech.Engine.DEFAULT_RATE; in initSettings()
242 for (TextToSpeech.EngineInfo engine : engines) { in initSettings()
256 if (status == TextToSpeech.SUCCESS) { in onInitEngine()
320 if (defaultAvailable == TextToSpeech.LANG_NOT_SUPPORTED || in evaluateDefaultLocale()
540 if (status == TextToSpeech.SUCCESS) { in onUpdateEngine()
[all …]
H A DTtsEngineSettingsFragment.java28 import android.speech.tts.TextToSpeech;
91 private TextToSpeech mTts;
95 private final TextToSpeech.OnInitListener mTtsInitListener = new TextToSpeech.OnInitListener() {
98 if (status != TextToSpeech.SUCCESS) {
187 mTts = new TextToSpeech(getActivity().getApplicationContext(), mTtsInitListener, in onCreate()
194 new IntentFilter(TextToSpeech.Engine.ACTION_TTS_DATA_INSTALLED)); in onCreate()
218 Intent intent = new Intent(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA); in checkTtsData()
231 if (resultCode != TextToSpeech.Engine.CHECK_VOICE_DATA_FAIL) { in onActivityResult()
250 TextToSpeech.Engine.EXTRA_AVAILABLE_VOICES); in updateVoiceDetails()
252 TextToSpeech.Engine.EXTRA_UNAVAILABLE_VOICES); in updateVoiceDetails()
[all …]
/aosp12/packages/apps/Car/Settings/src/com/android/car/settings/tts/
H A DPreferredEngineOptionsPreferenceController.java24 import android.speech.tts.TextToSpeech;
45 private TextToSpeech mTts;
66 for (TextToSpeech.EngineInfo engine : mEnginesHelper.getEngines()) { in onCreateInternal()
72 TextToSpeech.EngineInfo current = mEnginesHelper.getEngineInfo( in onCreateInternal()
95 TextToSpeech.EngineInfo current = mEnginesHelper.getEngineInfo(mTts.getCurrentEngine()); in updateState()
106 private boolean areEnginesEqual(TextToSpeech.EngineInfo engine1, in areEnginesEqual()
107 TextToSpeech.EngineInfo engine2) { in areEnginesEqual()
111 private boolean areEnginesEqual(TextToSpeech.EngineInfo engine, CharSequence name, in areEnginesEqual()
152 if (status == TextToSpeech.SUCCESS) { in onUpdateEngine()
174 TextToSpeech createTts(TextToSpeech.OnInitListener listener, String engine) { in createTts()
[all …]
H A DTtsPlaybackSettingsManager.java22 import android.speech.tts.TextToSpeech;
68 private final TextToSpeech mTts;
71 TtsPlaybackSettingsManager(Context context, @NonNull TextToSpeech tts, in TtsPlaybackSettingsManager()
87 Settings.Secure.TTS_DEFAULT_RATE, TextToSpeech.Engine.DEFAULT_RATE); in getCurrentSpeechRate()
91 updateSpeechRate(TextToSpeech.Engine.DEFAULT_RATE); in resetSpeechRate()
103 Settings.Secure.TTS_DEFAULT_PITCH, TextToSpeech.Engine.DEFAULT_PITCH); in getCurrentVoicePitch()
107 updateVoicePitch(TextToSpeech.Engine.DEFAULT_PITCH); in resetVoicePitch()
142 boolean success = resultCode != TextToSpeech.LANG_NOT_SUPPORTED in updateTtsLocale()
143 && resultCode != TextToSpeech.LANG_MISSING_DATA; in updateTtsLocale()
155 >= TextToSpeech.LANG_AVAILABLE) { in speakSampleText()
[all …]
H A DTtsPlaybackPreferenceController.java27 import android.speech.tts.TextToSpeech;
73 private TextToSpeech mTts;
93 final TextToSpeech.OnInitListener mOnInitListener = status -> {
94 if (status == TextToSpeech.SUCCESS) {
198 Intent intent = new Intent(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA); in startEngineVoiceDataCheck()
219 Intent intent = new Intent(TextToSpeech.Engine.ACTION_GET_SAMPLE_TEXT); in startGetSampleText()
245 if (data == null || resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_FAIL) { in onVoiceDataIntegrityCheckDone()
274 if (resultCode == TextToSpeech.LANG_AVAILABLE && data != null) { in onSampleTextReceived()
275 String tmp = data.getStringExtra(TextToSpeech.Engine.EXTRA_SAMPLE_TEXT); in onSampleTextReceived()
350 TextToSpeech createTts() { in createTts()
[all …]
H A DPreferredEngineEntryPreferenceController.java22 import android.speech.tts.TextToSpeech;
60 TextToSpeech.EngineInfo info = mEnginesHelper.getEngineInfo( in onCreateInternal()
73 TextToSpeech.EngineInfo info = mEnginesHelper.getEngineInfo( in updateState()
/aosp12/packages/apps/Car/Settings/tests/robotests/src/com/android/car/settings/testutils/
H A DShadowTextToSpeech.java21 import android.speech.tts.TextToSpeech;
30 @Implements(TextToSpeech.class)
33 private static TextToSpeech sInstance;
34 private static TextToSpeech.OnInitListener sOnInitListener;
37 public static void setInstance(TextToSpeech textToSpeech) { in setInstance()
45 public void __constructor__(Context context, TextToSpeech.OnInitListener listener, in __constructor__()
52 public void __constructor__(Context context, TextToSpeech.OnInitListener listener, in __constructor__()
57 public void __constructor__(Context context, TextToSpeech.OnInitListener listener) { in __constructor__()
H A DShadowTtsEngines.java20 import android.speech.tts.TextToSpeech;
44 protected List<TextToSpeech.EngineInfo> getEngines() { in getEngines()
49 protected TextToSpeech.EngineInfo getEngineInfo(String packageName) { in getEngineInfo()
/aosp12/packages/apps/Settings/src/com/android/settings/tts/
H A DTextToSpeechSettings.java32 import android.speech.tts.TextToSpeech;
33 import android.speech.tts.TextToSpeech.EngineInfo;
121 private int mDefaultPitch = TextToSpeech.Engine.DEFAULT_PITCH;
122 private int mDefaultRate = TextToSpeech.Engine.DEFAULT_RATE;
129 private TextToSpeech mTts = null;
246 final Pair<TextToSpeech, Boolean> ttsAndNew = in onResume()
259 TextToSpeech.Engine.DEFAULT_PITCH) / 100.0f); in onResume()
386 if (status == TextToSpeech.SUCCESS) { in onInitEngine()
457 if (defaultAvailable == TextToSpeech.LANG_NOT_SUPPORTED || in evaluateDefaultLocale()
458 defaultAvailable == TextToSpeech.LANG_MISSING_DATA || in evaluateDefaultLocale()
[all …]
H A DTextToSpeechViewModel.java20 import android.speech.tts.TextToSpeech;
30 private TextToSpeech mTts;
59 protected Pair<TextToSpeech, Boolean> getTtsAndWhetherNew( in getTtsAndWhetherNew()
60 TextToSpeech.OnInitListener listener) { in getTtsAndWhetherNew()
63 mTts = new TextToSpeech(this.mApplication, listener); in getTtsAndWhetherNew()
H A DTtsEnginePreferenceFragment.java10 import android.speech.tts.TextToSpeech;
11 import android.speech.tts.TextToSpeech.EngineInfo;
38 private TextToSpeech mTts = null;
46 private final TextToSpeech.OnInitListener mUpdateListener =
47 new TextToSpeech.OnInitListener() {
59 mTts = new TextToSpeech(mContext, null); in onCreate()
84 if (status == TextToSpeech.SUCCESS) { in onUpdateEngine()
94 mTts = new TextToSpeech(mContext, null, mPreviousEngine); in onUpdateEngine()
189 mTts = new TextToSpeech(mContext, mUpdateListener, engine); in updateDefaultEngine()
/aosp12/packages/apps/Car/libs/car-assist-client-lib/src/com/android/car/assist/client/tts/
H A DAndroidTextToSpeechEngine.java22 import android.speech.tts.TextToSpeech;
33 private TextToSpeech mTextToSpeech;
36 public void initialize(Context context, TextToSpeech.OnInitListener initListener) { in initialize()
38 mTextToSpeech = new TextToSpeech(context, initListener); in initialize()
87 return TextToSpeech.Engine.DEFAULT_STREAM; in getStream()
H A DTextToSpeechHelper.java24 import android.speech.tts.TextToSpeech;
109 mInitStatus = TextToSpeech.STOPPED; in TextToSpeechHelper()
172 if (mInitStatus == TextToSpeech.STOPPED) { in requestPlay()
201 if (mInitStatus == TextToSpeech.ERROR) { in playInternal()
220 if (mTextToSpeechEngine.speak(text, TextToSpeech.QUEUE_ADD, /* params= */ null, in playInternal()
221 utteranceId) != TextToSpeech.SUCCESS) { in playInternal()
254 mInitStatus = TextToSpeech.STOPPED; in shutdownEngine()
/aosp12/frameworks/base/core/tests/coretests/src/com/android/internal/accessibility/
H A DAccessibilityShortcutControllerTest.java61 import android.speech.tts.TextToSpeech;
121 private @Mock TextToSpeech mTextToSpeech;
496 TextToSpeech.OnInitListener.class); in testOnAccessibilityShortcut_showsWarningDialog_shouldTtsSpokenPrompt()
498 onInitCap.getValue().onInit(TextToSpeech.SUCCESS); in testOnAccessibilityShortcut_showsWarningDialog_shouldTtsSpokenPrompt()
499 verify(mTextToSpeech).speak(any(), eq(TextToSpeech.QUEUE_FLUSH), any(), any()); in testOnAccessibilityShortcut_showsWarningDialog_shouldTtsSpokenPrompt()
521 TextToSpeech.OnInitListener.class); in testOnAccessibilityShortcut_showsWarningDialog_ttsInitFail_noSpokenPrompt()
523 onInitCap.getValue().onInit(TextToSpeech.ERROR); in testOnAccessibilityShortcut_showsWarningDialog_ttsInitFail_noSpokenPrompt()
538 features.add(TextToSpeech.Engine.KEY_FEATURE_NOT_INSTALLED); in testOnAccessibilityShortcut_showsWarningDialog_ttsLongTimeInit_retrySpoken()
540 doReturn(TextToSpeech.LANG_NOT_SUPPORTED, TextToSpeech.LANG_AVAILABLE) in testOnAccessibilityShortcut_showsWarningDialog_ttsLongTimeInit_retrySpoken()
546 TextToSpeech.OnInitListener.class); in testOnAccessibilityShortcut_showsWarningDialog_ttsLongTimeInit_retrySpoken()
[all …]
/aosp12/frameworks/base/core/java/com/android/internal/accessibility/
H A DAccessibilityShortcutController.java46 import android.speech.tts.TextToSpeech;
468 private class TtsPrompt implements TextToSpeech.OnInitListener {
476 private TextToSpeech mTts;
494 if (status != TextToSpeech.SUCCESS) { in onInit()
507 final int status = mTts.speak(mText, TextToSpeech.QUEUE_FLUSH, null, null); in play()
508 if (status != TextToSpeech.SUCCESS) { in play()
526 mLanguageReady = status != TextToSpeech.LANG_MISSING_DATA in waitForTtsReady()
527 && status != TextToSpeech.LANG_NOT_SUPPORTED; in waitForTtsReady()
534 TextToSpeech.Engine.KEY_FEATURE_NOT_INSTALLED); in waitForTtsReady()
626 public TextToSpeech getTextToSpeech(Context ctx, TextToSpeech.OnInitListener listener) { in getTextToSpeech()
[all …]
/aosp12/packages/apps/Settings/tests/robotests/src/com/android/settings/testutils/shadow/
H A DShadowTtsEngines.java20 import android.speech.tts.TextToSpeech;
44 protected List<TextToSpeech.EngineInfo> getEngines() { in getEngines()
49 protected TextToSpeech.EngineInfo getEngineInfo(String packageName) { in getEngineInfo()
/aosp12/frameworks/base/media/tests/ScoAudioTest/src/com/android/scoaudiotest/
H A DScoAudioTest.java35 import android.speech.tts.TextToSpeech;
36 import android.speech.tts.TextToSpeech.OnUtteranceCompletedListener;
69 private TextToSpeech mTts;
131 mTts = new TextToSpeech(this, new TtsInitListener()); in onCreate()
133 mTtsParams.put(TextToSpeech.Engine.KEY_PARAM_STREAM, in onCreate()
135 mTtsParams.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, in onCreate()
509 class TtsInitListener implements TextToSpeech.OnInitListener {
514 if (status != TextToSpeech.SUCCESS) { in onInit()
526 if (result == TextToSpeech.LANG_MISSING_DATA || in onInit()
527 result == TextToSpeech.LANG_NOT_SUPPORTED) { in onInit()
[all …]

123