MapboxSpeechApi

class MapboxSpeechApi @JvmOverloads constructor(    context: Context,     accessToken: String,     language: String,     options: MapboxSpeechApiOptions = MapboxSpeechApiOptions.Builder().build())

Mapbox Speech Api that allows you to generate an announcement based on VoiceInstructions

Parameters

context

Context

accessToken

String

language

Locale language (IETF BCP 47)

options

Constructors

Link copied to clipboard
fun MapboxSpeechApi(    context: Context,     accessToken: String,     language: String,     options: MapboxSpeechApiOptions = MapboxSpeechApiOptions.Builder().build())

Functions

Link copied to clipboard
fun cancel()

The method stops the process of retrieving the file voice instruction SpeechAnnouncement and destroys any related callbacks.

Link copied to clipboard
fun clean(announcement: SpeechAnnouncement)

Given the SpeechAnnouncement the method may cleanup any associated files previously generated.

Link copied to clipboard
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.