Class SpeechPlayerProvider
-
- All Implemented Interfaces:
public class SpeechPlayerProviderGiven to the constructor of NavigationSpeechPlayer, this class decides which SpeechPlayer should be used based on voice language compatibility.
If the given voiceLanguage is not null, this means the language is supported by the TrimbleMaps Voice API, which can parse SSML. The boolean voiceLanguageSupported should be try in this case.
If false, an instance of TrimbleMapsSpeechPlayer will never be provided to the NavigationSpeechPlayer. The SDK will default to the AndroidSpeechPlayer powered by android.speech.tts.TextToSpeech.
-
-
Constructor Summary
Constructors Constructor Description SpeechPlayerProvider(Context context, String language, boolean voiceLanguageSupported, VoiceInstructionLoader voiceInstructionLoader, boolean shouldBeep)Constructed when creating an instance of NavigationSpeechPlayer.
-
Method Summary
Modifier and Type Method Description voidsetIsFallbackAlwaysEnabled(boolean isFallbackAlwaysEnabled)Set false to not fallback to TTS for voice guidance when the connection is slow.
-
-
-
Constructor Detail
-
SpeechPlayerProvider
SpeechPlayerProvider(Context context, String language, boolean voiceLanguageSupported, VoiceInstructionLoader voiceInstructionLoader, boolean shouldBeep)
Constructed when creating an instance of NavigationSpeechPlayer.- Parameters:
context- for the initialization of the speech playerslanguage- to be usedvoiceLanguageSupported- true if voiceLanguage is not null, false otherwisevoiceInstructionLoader- voice instruction loader
-
-
Method Detail
-
setIsFallbackAlwaysEnabled
void setIsFallbackAlwaysEnabled(boolean isFallbackAlwaysEnabled)
Set false to not fallback to TTS for voice guidance when the connection is slow. The default setting is enabled. The TTS is used in two cases: 1. when request polly voice fails 2. when connection is slow This setting only impact the 2nd case.
- Parameters:
isFallbackAlwaysEnabled- true to use TTS when connection is slow, false otherwise
-
-