generatePredownloaded

fun generatePredownloaded(voiceInstruction: VoiceInstructions, consumer: MapboxNavigationConsumer<Expected<SpeechError, SpeechValue>>)

Given VoiceInstructions the method will try to generate the voice instruction SpeechAnnouncement including the synthesized speech mp3 file from Mapbox's API Voice. NOTE: this method will NOT try downloading an mp3 file from server. It will either use an already predownloaded file or an onboard speech synthesizer. Only invoke this method if you use voice instructions predownloading (see VoiceInstructionsPrefetcher), otherwise invoke generatePredownloaded in your VoiceInstructionsObserver.

See also

Parameters

voiceInstruction

VoiceInstructions object representing VoiceInstructions

consumer

is a SpeechValue including the announcement to be played when the announcement is ready or a SpeechError including the error information and a fallback with the raw announcement (without file) that can be played with a text-to-speech engine.