SpokenInstruction

An instruction about an upcoming RouteStep’s maneuver, optimized for speech synthesis.

The instruction is provided in two formats: plain text and text marked up according to the Speech Synthesis Markup Language (SSML). Use a speech synthesizer such as AVSpeechSynthesizer or Amazon Polly to read aloud the instruction.

The distanceAlongStep property is measured from the beginning of the step associated with this object. By contrast, the text and ssmlText properties refer to the details in the following step. It is also possible for the instruction to refer to two following steps simultaneously when needed for safe navigation.

  • A distance along the associated RouteStep at which to read the instruction aloud.

    The distance is measured in meters from the beginning of the associated step.

  • A plain-text representation of the speech-optimized instruction.

    This representation is appropriate for speech synthesizers that lack support for the Speech Synthesis Markup Language (SSML), such as AVSpeechSynthesizer. For speech synthesizers that support SSML, use the ssmlText property instead.

  • A formatted representation of the speech-optimized instruction.

    This representation is appropriate for speech synthesizers that support the Speech Synthesis Markup Language (SSML), such as Amazon Polly. Numbers and names are marked up to ensure correct pronunciation. For speech synthesizers that lack SSML support, use the text property instead.