MapboxVoiceInstructionsPlayer
Hybrid implementation of MapboxVoiceInstructionsPlayer combining VoiceInstructionsTextPlayer and VoiceInstructionsFilePlayer speech players. NOTE: do not use lazy initialization for this class since it takes some time to initialize the system services required for on-device speech synthesis. With lazy initialization there is a high risk that said services will not be available when the first instruction has to be played. MapboxVoiceInstructionsPlayer should be instantiated in Activity#onCreate
.
Parameters
Context
VoiceInstructionsPlayerOptions (optional)
AsyncAudioFocusDelegate (optional)
Provider (optional)
Constructors
Functions
Given SpeechAnnouncement the method will play the voice instruction. If a voice instruction is already playing or other announcement are already queued, the given voice instruction will be queued to play after.
Change language in runtime.
The method will set the volume to the specified level from SpeechVolume. Volume is specified as a float ranging from 0 to 1 where 0 is silence, and 1 is the maximum volume (the default behavior).