generate

fun generate(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.

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.