|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
final String statusText; |
|
|
final String statusText; |
|
|
if (!getPackageName().equals(mTts.getDefaultEngine())) { |
|
|
|
|
|
statusText = getString(R.string.set_default_message); |
|
|
|
|
|
} else { |
|
|
|
|
|
switch (mState) { |
|
|
|
|
|
case ERROR: |
|
|
|
|
|
statusText = getString(R.string.error_message); |
|
|
|
|
|
break; |
|
|
|
|
|
case DOWNLOAD_FAILED: |
|
|
|
|
|
statusText = getString(R.string.voice_data_failed_message); |
|
|
|
|
|
break; |
|
|
|
|
|
default: |
|
|
|
|
|
|
|
|
switch (mState) { |
|
|
|
|
|
case ERROR: |
|
|
|
|
|
statusText = getString(R.string.error_message); |
|
|
|
|
|
break; |
|
|
|
|
|
case DOWNLOAD_FAILED: |
|
|
|
|
|
statusText = getString(R.string.voice_data_failed_message); |
|
|
|
|
|
break; |
|
|
|
|
|
default: |
|
|
|
|
|
if (!getPackageName().equals(mTts.getDefaultEngine())) { |
|
|
|
|
|
statusText = getString(R.string.set_default_message); |
|
|
|
|
|
} else { |
|
|
statusText = null; |
|
|
statusText = null; |
|
|
break; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
break; |
|
|
} |
|
|
} |
|
|
if (statusText != null) { |
|
|
if (statusText != null) { |
|
|
final String statusLabel = getString(R.string.status); |
|
|
final String statusLabel = getString(R.string.status); |
|
|
|
|
|
|
|
|
* @param status The TTS engine initialization status. |
|
|
* @param status The TTS engine initialization status. |
|
|
*/ |
|
|
*/ |
|
|
private void onInitialized(int status) { |
|
|
private void onInitialized(int status) { |
|
|
if (status == TextToSpeech.ERROR) { |
|
|
|
|
|
|
|
|
if (status != TextToSpeech.SUCCESS) { |
|
|
Log.e(TAG, "Initialization failed (status: " + status + ")."); |
|
|
Log.e(TAG, "Initialization failed (status: " + status + ")."); |
|
|
setState(State.ERROR); |
|
|
setState(State.ERROR); |
|
|
} else { |
|
|
} else { |