Class SpeechPlayerProvider

  • All Implemented Interfaces:

    
    public class SpeechPlayerProvider
    
                        

    Given 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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      void setIsFallbackAlwaysEnabled(boolean isFallbackAlwaysEnabled) Set false to not fallback to TTS for voice guidance when the connection is slow.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 players
        language - to be used
        voiceLanguageSupported - true if voiceLanguage is not null, false otherwise
        voiceInstructionLoader - 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