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.
-
-
Field Summary
Fields Modifier and Type Field Description public booleanisMuted
-
Constructor Summary
Constructors Constructor Description NavigationSpeechPlayer(SpeechPlayerProvider speechPlayerProvider)
-
Method Summary
Modifier and Type Method Description booleanisMuted()Returns the current muted state of the player. voidsetMuted(boolean isMuted)Mutes or un-mutes the SpeechPlayer. voidplay(VoiceInstructions voiceInstructions)Plays the given VoiceInstructions. voidonOffRoute()Optional method to implement in an OffRouteObserver. voidonDestroy()Required method to implement in onDestroy or onDestroy.
-
-
-
Constructor Detail
-
NavigationSpeechPlayer
NavigationSpeechPlayer(SpeechPlayerProvider speechPlayerProvider)
-
-
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()
-
-