Home
last modified time | relevance | path

Searched refs:mTts (Results 1 – 11 of 11) sorted by relevance

/packages/apps/TvSettings/Settings/src/com/android/tv/settings/system/
DTextToSpeechFragment.java112 private TextToSpeech mTts = null; field in TextToSpeechFragment
191 mTts = new TextToSpeech(getActivity().getApplicationContext(), mInitListener); in onCreate()
207 if (mTts == null || mCurrentDefaultLocale == null) { in onResume()
210 Locale ttsDefaultLocale = mTts.getDefaultLanguage(); in onResume()
219 mTts.setOnUtteranceProgressListener(null); in onStop()
226 if (mTts != null) { in onDestroy()
227 mTts.shutdown(); in onDestroy()
228 mTts = null; in onDestroy()
233 if (mTts == null) { in setTtsUtteranceProgressListener()
236 mTts.setOnUtteranceProgressListener(mUtteranceProgressListener); in setTtsUtteranceProgressListener()
[all …]
DTtsEngineSettingsFragment.java91 private TextToSpeech mTts; field in TtsEngineSettingsFragment
187 mTts = new TextToSpeech(getActivity().getApplicationContext(), mTtsInitListener, in onCreate()
201 mTts.shutdown(); in onDestroy()
243 mTts.getCurrentEngine()); in updateVoiceDetails()
386 if (getEngineName().equals(mTts.getCurrentEngine())) { in updateLanguageTo()
388 mTts.setLanguage((locale != null) ? locale : Locale.getDefault()); in updateLanguageTo()
/packages/apps/Car/Settings/src/com/android/car/settings/tts/
DPreferredEngineOptionsPreferenceController.java45 private TextToSpeech mTts; field in PreferredEngineOptionsPreferenceController
64 mTts = createTts(/* listener= */ null, /* engine= */ null); in onCreateInternal()
73 mTts.getCurrentEngine()); in onCreateInternal()
87 if (mTts != null) { in onDestroyInternal()
88 mTts.shutdown(); in onDestroyInternal()
89 mTts = null; in onDestroyInternal()
95 TextToSpeech.EngineInfo current = mEnginesHelper.getEngineInfo(mTts.getCurrentEngine()); in updateState()
124 mPreviousEngine = mTts.getCurrentEngine(); in updateDefaultEngine()
128 if (mTts != null) { in updateDefaultEngine()
129 mTts.shutdown(); in updateDefaultEngine()
[all …]
DTtsPlaybackSettingsManager.java68 private final TextToSpeech mTts; field in TtsPlaybackSettingsManager
74 mTts = tts; in TtsPlaybackSettingsManager()
81 mTts.setSpeechRate(speechRate / SCALING_FACTOR); in updateSpeechRate()
97 mTts.setPitch(pitch / SCALING_FACTOR); in updateVoicePitch()
117 if (!mEnginesHelper.isLocaleSetToDefaultForEngine(mTts.getCurrentEngine())) { in getStoredTtsLocale()
118 currentLocale = mEnginesHelper.getLocalePrefForEngine(mTts.getCurrentEngine()); in getStoredTtsLocale()
130 if (mTts.getVoice() == null) { in getEffectiveTtsLocale()
133 return mEnginesHelper.parseLocaleString(mTts.getVoice().getLocale().toString()); in getEffectiveTtsLocale()
141 int resultCode = mTts.setLanguage((newLocale != null) ? newLocale : Locale.getDefault()); in updateTtsLocale()
145 mEnginesHelper.updateLocalePrefForEngine(mTts.getCurrentEngine(), newLocale); in updateTtsLocale()
[all …]
DTtsPlaybackPreferenceController.java73 private TextToSpeech mTts; field in TtsPlaybackPreferenceController
96 mTtsPlaybackManager = new TtsPlaybackSettingsManager(getContext(), mTts,
98 mTts.setSpeechRate(mTtsPlaybackManager.getCurrentSpeechRate()
100 mTts.setPitch(mTtsPlaybackManager.getCurrentVoicePitch()
102 startEngineVoiceDataCheck(mTts.getCurrentEngine());
140 mTts = createTts(); in onCreateInternal()
150 if (mTts != null) { in onDestroyInternal()
151 mTts.shutdown(); in onDestroyInternal()
152 mTts = null; in onDestroyInternal()
214 String currentEngine = mTts.getCurrentEngine(); in startGetSampleText()
[all …]
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/tts/
DTtsPlaybackSettingsManagerTest.java56 private TextToSpeech mTts; field in TtsPlaybackSettingsManagerTest
64 mPlaybackSettingsManager = new TtsPlaybackSettingsManager(mContext, mTts, mEnginesHelper); in setUp()
66 when(mTts.getCurrentEngine()).thenReturn(ENGINE_NAME); in setUp()
86 verify(mTts).setSpeechRate(newSpeechRate / TtsPlaybackSettingsManager.SCALING_FACTOR); in updateSpeechRate_updatesTts()
121 verify(mTts).setPitch(newVoicePitch / TtsPlaybackSettingsManager.SCALING_FACTOR); in updateVoicePitch_updatesTts()
162 verify(mTts).setLanguage(Locale.KOREAN); in updateTtsLocale_nonNullLocale_setsLanguage()
169 verify(mTts).setLanguage(Locale.getDefault()); in updateTtsLocale_nullLocale_setsDefaultLanguage()
174 when(mTts.setLanguage(Locale.KOREAN)).thenReturn(TextToSpeech.LANG_AVAILABLE); in updateTtsLocale_nonNullLocale_correctResultCode_updatesLocalePref()
182 when(mTts.setLanguage(Locale.KOREAN)).thenReturn(TextToSpeech.LANG_MISSING_DATA); in updateTtsLocale_nonNullLocale_wrongResultCode_doesNotUpdateLocalePref()
197 when(mTts.getVoice()).thenReturn(voice); in speakSampleText_requiresNetworkConnection_languageNotAvailable_showsAlert()
[all …]
/packages/apps/Settings/src/com/android/settings/tts/
DTextToSpeechSettings.java129 private TextToSpeech mTts = null; field in TextToSpeechSettings
213 mTts = ttsAndNew.first; in onCreate()
235 if (mTts == null || mCurrentDefaultLocale == null) { in onResume()
238 if (!mTts.getDefaultEngine().equals(mTts.getCurrentEngine())) { in onResume()
250 mTts = ttsAndNew.first; in onResume()
260 mTts.setPitch(android.provider.Settings.Secure.getInt(resolver, TTS_DEFAULT_PITCH, in onResume()
264 Locale ttsDefaultLocale = mTts.getDefaultLanguage(); in onResume()
272 if (mTts == null) { in setTtsUtteranceProgressListener()
275 mTts.setOnUtteranceProgressListener(new UtteranceProgressListener() { in setTtsUtteranceProgressListener()
333 if (mTts != null) { in initSettings()
[all …]
DTtsEnginePreferenceFragment.java38 private TextToSpeech mTts = null; field in TtsEnginePreferenceFragment
59 mTts = new TextToSpeech(mContext, null); in onCreate()
67 if (mTts != null) { in onDestroy()
68 mTts.shutdown(); in onDestroy()
69 mTts = null; in onDestroy()
86 + mTts.getCurrentEngine()); in onUpdateEngine()
88 mContext.getContentResolver(), TTS_DEFAULT_SYNTH, mTts.getCurrentEngine()); in onUpdateEngine()
94 mTts = new TextToSpeech(mContext, null, mPreviousEngine); in onUpdateEngine()
170 if (mTts != null) { in updateDefaultEngine()
176 mPreviousEngine = mTts.getCurrentEngine(); in updateDefaultEngine()
[all …]
DTextToSpeechViewModel.java30 private TextToSpeech mTts; field in TextToSpeechViewModel
51 mTts.shutdown(); in shutdownTts()
52 mTts = null; in shutdownTts()
62 if (mTts == null) { in getTtsAndWhetherNew()
63 mTts = new TextToSpeech(this.mApplication, listener); in getTtsAndWhetherNew()
67 return Pair.create(mTts, ttsCreated); in getTtsAndWhetherNew()
/packages/apps/CellBroadcastReceiver/src/com/android/cellbroadcastreceiver/
DCellBroadcastAlertAudio.java128 public TextToSpeech mTts; field in CellBroadcastAlertAudio
177 mTts.setOnUtteranceCompletedListener(this); in onInit()
182 mTts = null; in onInit()
204 int result = mTts.setLanguage(locale); in setTtsLanguage()
264 mTts.setAudioAttributes(getAlertAudioAttributes()); in onCreate()
266 mTts.speak("", TextToSpeech.QUEUE_FLUSH, null, null); in onCreate()
267 res = mTts.speak(mMessageBody, 2, null, TTS_UTTERANCE_ID); in onCreate()
314 if (mTts != null) { in onDestroy()
316 mTts.shutdown(); in onDestroy()
429 if (mTts == null) { in handleStartIntent()
[all …]
/packages/apps/CellBroadcastReceiver/tests/unit/src/com/android/cellbroadcastreceiver/unit/
DCellBroadcastAlertAudioTest.java149 audio.mTts = mock(TextToSpeech.class); in setUpTtsInstance()
384 verify(audio.mTts, times(2)).speak(any(), queueMode.capture(), any(), any()); in testStartServiceWithTts()
422 verify(audio.mTts, times(1)).setLanguage(localeArgumentCaptor.capture()); in testSetTtsLanguage()