Class NavigationSpeechPlayer

  • All Implemented Interfaces:
    com.trimblemaps.navigation.ui.voice.SpeechPlayer

    
    public class NavigationSpeechPlayer
     implements SpeechPlayer
                        

    Used to play VoiceInstructionss.

    Takes a SpeechPlayerProvider which will provide either a TrimbleMapsSpeechPlayer or AndroidSpeechPlayer based on the given language - if it is supported by our Voice API.

    TrimbleMapsSpeechPlayer requires Internet connectivity. In cases where a connection is not available, the provider will fall back to the AndroidSpeechPlayer.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public boolean isMuted
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      boolean isMuted() Returns the current muted state of the player.
      void setMuted(boolean isMuted) Mutes or un-mutes the SpeechPlayer.
      void play(VoiceInstructions voiceInstructions) Plays the given VoiceInstructions.
      void onOffRoute() Optional method to implement in an OffRouteObserver.
      void onDestroy() Required method to implement in onDestroy or onDestroy.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • isMuted

         boolean isMuted()

        Returns the current muted state of the player.

      • setMuted

         void setMuted(boolean isMuted)

        Mutes or un-mutes the SpeechPlayer.

        If an announcement is playing at the time this method is called, the announcement will be stopped immediately.

        Parameters:
        isMuted - true to mute, false to un-mute
      • play

         void play(VoiceInstructions voiceInstructions)

        Plays the given VoiceInstructions.

        Parameters:
        voiceInstructions - with SSML and normal announcement text
      • onOffRoute

         void onOffRoute()

        Optional method to implement in an OffRouteObserver.

        During an off-route scenario, you can use this method to cancel existing announcements without completely muting the player.

      • onDestroy

         void onDestroy()

        Required method to implement in onDestroy or onDestroy.

        Ensures the player is properly shutdown and finishes any running announcements.