small refactoring of voice engine status variables
This commit is contained in:
parent
3269cc13a6
commit
19a8d63ecc
3 changed files with 12 additions and 12 deletions
|
@ -137,11 +137,11 @@ public class TestVoiceActivity extends OsmandActionBarActivity {
|
|||
v += "\n \u25CF OsmAnd voice: " + osmandVoice;
|
||||
v += "\n \u25CF OsmAnd voice language: " + osmandVoiceLang;
|
||||
|
||||
v += "\n \u25CF TTS voice language availability: " + (TTSCommandPlayerImpl.getTtsVoiceStatus().equals("") ? "-" : TTSCommandPlayerImpl.getTtsVoiceStatus());
|
||||
v += "\n \u25CF TTS voice actually used: " + (TTSCommandPlayerImpl.getTtsVoiceUsed().equals("") ? "-" : TTSCommandPlayerImpl.getTtsVoiceUsed());
|
||||
v += "\n \u25CF TTS voice language availability: " + TTSCommandPlayerImpl.getTtsVoiceStatus();
|
||||
v += "\n \u25CF TTS voice actually used: " + TTSCommandPlayerImpl.getTtsVoiceUsed();
|
||||
|
||||
if (((OsmandApplication) getApplication()).getSettings().AUDIO_STREAM_GUIDANCE.get() == 0) {
|
||||
v += "\n \u25CF BT SCO: " + (AbstractPrologCommandPlayer.btScoInit.equals("") ? "-" : AbstractPrologCommandPlayer.btScoInit);
|
||||
v += "\n \u25CF BT SCO: " + AbstractPrologCommandPlayer.btScoInit;
|
||||
} else {
|
||||
v += "\n \u25CF BT SCO: The current app profile is not set to use 'Phone call audio'.";
|
||||
}
|
||||
|
|
|
@ -326,7 +326,7 @@ public abstract class AbstractPrologCommandPlayer implements CommandPlayer, Stat
|
|||
//public static final int BT_SCO_DELAY = 1500;
|
||||
|
||||
// This only needed for init debugging in TestVoiceActivity:
|
||||
public static String btScoInit = "";
|
||||
public static String btScoInit = "-";
|
||||
|
||||
private synchronized boolean toggleBtSco(boolean on) {
|
||||
// Hardy, 2016-07-03: Establish a low quality BT SCO (Synchronous Connection-Oriented) link to interrupt e.g. a car stereo FM radio
|
||||
|
|
|
@ -68,8 +68,8 @@ public class TTSCommandPlayerImpl extends AbstractPrologCommandPlayer {
|
|||
// TODO: We could actually remove v102 support, I am done updating all existing 35 TTS voices to v103. Hardy, July 2016
|
||||
private static final Log log = PlatformUtil.getLog(TTSCommandPlayerImpl.class);
|
||||
private static TextToSpeech mTts;
|
||||
private static String ttsVoiceStatus = "";
|
||||
private static String ttsVoiceUsed = "";
|
||||
private static String ttsVoiceStatus = "-";
|
||||
private static String ttsVoiceUsed = "-";
|
||||
private Context mTtsContext;
|
||||
private HashMap<String, String> params = new HashMap<String, String>();
|
||||
private VoiceRouter vrt;
|
||||
|
@ -175,8 +175,8 @@ public class TTSCommandPlayerImpl extends AbstractPrologCommandPlayer {
|
|||
}
|
||||
if (mTts == null) {
|
||||
mTtsContext = ctx;
|
||||
ttsVoiceStatus = "";
|
||||
ttsVoiceUsed = "";
|
||||
ttsVoiceStatus = "-";
|
||||
ttsVoiceUsed = "-";
|
||||
ttsRequests = 0;
|
||||
final float speechRate = cSpeechRate;
|
||||
|
||||
|
@ -220,7 +220,7 @@ public class TTSCommandPlayerImpl extends AbstractPrologCommandPlayer {
|
|||
case TextToSpeech.LANG_AVAILABLE:
|
||||
ttsVoiceStatus = newLocale.getDisplayName() + ": LANG_AVAILABLE";
|
||||
case TextToSpeech.LANG_COUNTRY_AVAILABLE:
|
||||
ttsVoiceStatus = "".equals(ttsVoiceStatus) ? newLocale.getDisplayName() + ": LANG_COUNTRY_AVAILABLE" : ttsVoiceStatus;
|
||||
ttsVoiceStatus = "-".equals(ttsVoiceStatus) ? newLocale.getDisplayName() + ": LANG_COUNTRY_AVAILABLE" : ttsVoiceStatus;
|
||||
case TextToSpeech.LANG_COUNTRY_VAR_AVAILABLE:
|
||||
try {
|
||||
mTts.setLanguage(newLocale);
|
||||
|
@ -235,7 +235,7 @@ public class TTSCommandPlayerImpl extends AbstractPrologCommandPlayer {
|
|||
if(speechRate != 1) {
|
||||
mTts.setSpeechRate(speechRate);
|
||||
}
|
||||
ttsVoiceStatus = "".equals(ttsVoiceStatus) ? newLocale.getDisplayName() + ": LANG_COUNTRY_VAR_AVAILABLE" : ttsVoiceStatus;
|
||||
ttsVoiceStatus = "-".equals(ttsVoiceStatus) ? newLocale.getDisplayName() + ": LANG_COUNTRY_VAR_AVAILABLE" : ttsVoiceStatus;
|
||||
ttsVoiceUsed = getVoiceUsed();
|
||||
break;
|
||||
case TextToSpeech.LANG_NOT_SUPPORTED:
|
||||
|
@ -320,8 +320,8 @@ public class TTSCommandPlayerImpl extends AbstractPrologCommandPlayer {
|
|||
}
|
||||
abandonAudioFocus();
|
||||
mTtsContext = null;
|
||||
ttsVoiceStatus = "";
|
||||
ttsVoiceUsed = "";
|
||||
ttsVoiceStatus = "-";
|
||||
ttsVoiceUsed = "-";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue