MapboxVoiceController
MapboxVoiceController
extends the default RouteVoiceController
by providing a more robust speech synthesizer via the Mapbox Speech API. RouteVoiceController
will be used as a fallback during poor network conditions.
-
Number of seconds a request can wait before it is canceled and the default speech synthesizer speaks the instruction.
-
Number of steps ahead of the current step to cache spoken instructions.
-
An
AVAudioPlayer
through which spoken instructions are played. -
-
-
-
Speaks an instruction.
The cache is first checked to see if we have already downloaded the speech file. If not, the instruction is fetched and played. If there is an error anywhere along the way, the instruction will be spoken with the default speech synthesizer.
-
Speaks an instruction with the built in speech synthesizer.
This method should be used in cases where
fetch(instruction:)
orplay(_:)
fails. -
Fetches and plays an instruction.
-
Caches an instruction in an in-memory cache.
-
Plays an audio file.