SpeechPlayerProvider

open 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 Mapbox Voice API, which can parse SSML. The boolean voiceLanguageSupported should be try in this case.

If false, an instance of MapboxSpeechPlayer will never be provided to the NavigationSpeechPlayer. The SDK will default to the AndroidSpeechPlayer powered by android.speech.tts.TextToSpeech.

Constructors

SpeechPlayerProvider
Link copied to clipboard
open fun SpeechPlayerProvider(context: Context, language: String, voiceLanguageSupported: Boolean, voiceInstructionLoader: VoiceInstructionLoader)
Constructed when creating an instance of NavigationSpeechPlayer.
SpeechPlayerProvider
Link copied to clipboard
open fun SpeechPlayerProvider(context: Context, language: String, voiceLanguageSupported: Boolean, voiceInstructionLoader: VoiceInstructionLoader, connectivityStatus: ConnectivityStatusProvider)

Functions

onDestroy
Link copied to clipboard
open fun onDestroy()
onOffRoute
Link copied to clipboard
open fun onOffRoute()
onSpeechPlayerStateChanged
Link copied to clipboard
open fun onSpeechPlayerStateChanged(speechPlayerState: SpeechPlayerState)
retrieveAndroidSpeechPlayer
Link copied to clipboard
open fun retrieveAndroidSpeechPlayer(): AndroidSpeechPlayer
retrieveSpeechPlayer
Link copied to clipboard
open fun retrieveSpeechPlayer(): SpeechPlayer
setMuted
Link copied to clipboard
open fun setMuted(isMuted: Boolean)
setSpeechPlayerStateChangeObserver
Link copied to clipboard
open fun setSpeechPlayerStateChangeObserver(observer: SpeechPlayerStateChangeObserver)

Properties

isFallbackAlwaysEnabled
Link copied to clipboard
private open var isFallbackAlwaysEnabled: Boolean