HERE Android SDK Developer's Guide

VoiceGuidanceOptions

The class VoiceGuidanceOptions is a member of com.here.android.mpa.guidance .

Class Summary

public class VoiceGuidanceOptions

extends java.lang.Object

Specifies at what times voice guidance prompts are triggered during car navigation.

[For complete information, see the section Class Details]

Nested Class Summary

Table 1. Nested Classes in VoiceGuidanceOptions
Nested Classes

public static class VoiceGuidanceOptions.Range

Represents a values range.

public static final enumeration VoiceGuidanceOptions.RoadType

Represents the type of road.

public static final enumeration VoiceGuidanceOptions.VoicePromptType

Represents the type of voice command.

Method Summary

Table 2. Methods in VoiceGuidanceOptions
Methods

public TtsOutputFormat getTtsOutputFormat ()

Gets the TTS text output format currently in use.

public Range getVoicePromptDistanceRangeFromPreviousManeuver (RoadType roadType, VoicePromptType voicePromptType)

Returns min and max distances after last maneuver to announce next one.

public Range getVoicePromptDistanceRangeToNextManeuver (RoadType roadType, VoicePromptType voicePromptType)

Returns min and max distance before next maneuver to announce.

public int getVoicePromptTimeBasedDistanceToNextManeuver (RoadType roadType, VoicePromptType voicePromptType)

Returns time based distance before next maneuver to announce.

public Range getVoicePromptTimeRangeFromPreviousManeuver (RoadType roadType, VoicePromptType voicePromptType)

Returns min and max time after last maneuver to announce next one.

public Range getVoicePromptTimeRangeToNextManeuver (RoadType roadType, VoicePromptType voicePromptType)

Returns min and max distances before next maneuver to announce.

public VoiceSkin getVoiceSkin ()

Gets the voice skin currently in use.

public boolean isManeuverVoicePromptEnabled (Action action)

Checks if voice prompts for certain maneuver is enabled.

public int isTtsLanguageAvailable (Locale locale)

Get the availability of the specified language as represented by the Locale .

public void resetAllVoicePromptRules ()

Resets all distance based and time based voice announcement rules.

public boolean setManeuverVoicePromptEnabled (Action action, boolean enabled)

Enables/disables voice prompts for certain maneuver.

public void setTtsOutputFormat (TtsOutputFormat format)

Sets the TTS text output format.

public void setVoicePromptDistanceRangeFromPreviousManeuver (RoadType roadType, VoicePromptType voicePromptType, Range distRange)

Configures voice guidance rules.

public void setVoicePromptDistanceRangeToNextManeuver (RoadType roadType, VoicePromptType voicePromptType, Range distRange)

Configures voice guidance rules.

public void setVoicePromptTimeBasedDistanceToNextManeuver (RoadType roadType, VoicePromptType voicePromptType, int distance)

Configures voice guidance rules.

public void setVoicePromptTimeRangeFromPreviousManeuver (RoadType roadType, VoicePromptType voicePromptType, Range timeRange)

Configures voice guidance rules.

public void setVoicePromptTimeRangeToNextManeuver (RoadType roadType, VoicePromptType voicePromptType, Range timeRange)

Configures voice guidance rules.

public Error setVoiceSkin (VoiceSkin skin)

Sets the voice skin id for voice Navigation.

Class Details

Specifies at what times voice guidance prompts are triggered during car navigation. For each upcoming maneuver, an instruction prompt to perform the maneuver is always triggered. In addition, up to three other prompts for performing the maneuver may be triggered, making a total of four possible prompt triggers per maneuver:

  • ANNOUNCEMENT - announcement of an upcoming maneuver ahead of time
  • REMINDER 2 - distant reminder, given from quite a distance away from the maneuver
  • REMINDER 1 - nearby reminder, given when the maneuver is getting close
  • COMMAND - call for immediate action just before the maneuver

A distinction is made according to whether the driver is currently on a non-highway or a highway, as more time is typically needed to allow the driver to react appropriately when driving on a highway.

The conditions are evaluated as follows: First the conditions for the trigger COMMAND are tested, then REMINDER 1, REMINDER 2, and finally ANNOUNCEMENT. For each trigger, the distance-based conditions are evaluated first. If these are not met, then the time-based conditions are evaluated. As soon as a condition is met, the corresponding prompt is triggered. Each type of prompt can be triggered automatically at most once per maneuver.

Just first ANNOUNCEMENT is issued immediately no matter what. Even if all parameters of ANNOUNCEMENT have been installed to -1 or any other values. If ANNOUNCEMENT has been disabled then neither REMINDER 2 nor REMINDER 1 would be issued, only COMMAND. If REMINDER 1 and REMINDER 2 met the same conditions then REMINDER 1 is issued, REMINDER 2 won't be issued.

The distance-based conditions are evaluated first. The time-based second. The time-based condition can be extended to take into consideration either time or distance conditions.

Use getVoiceGuidanceOptions() to obtain an instance of this class.

Method Details

public TtsOutputFormat getTtsOutputFormat ()

Gets the TTS text output format currently in use.

Returns:

The NavigationManager.TtsOutputFormat used.

public Range getVoicePromptDistanceRangeFromPreviousManeuver (RoadType roadType, VoicePromptType voicePromptType)

Returns min and max distances after last maneuver to announce next one.

Parameters:

Returns:

pair represents min and max values.

public Range getVoicePromptDistanceRangeToNextManeuver (RoadType roadType, VoicePromptType voicePromptType)

Returns min and max distance before next maneuver to announce.

Parameters:

Returns:

pair represents min and max values.

public int getVoicePromptTimeBasedDistanceToNextManeuver (RoadType roadType, VoicePromptType voicePromptType)

Returns time based distance before next maneuver to announce.

Parameters:

Returns:

pair represents time based distance

public Range getVoicePromptTimeRangeFromPreviousManeuver (RoadType roadType, VoicePromptType voicePromptType)

Returns min and max time after last maneuver to announce next one.

Parameters:

Returns:

pair represents min and max values.

public Range getVoicePromptTimeRangeToNextManeuver (RoadType roadType, VoicePromptType voicePromptType)

Returns min and max distances before next maneuver to announce.

Parameters:

Returns:

pair represents min and max values.

public VoiceSkin getVoiceSkin ()

Gets the voice skin currently in use.

Returns:

The voice skin.

public boolean isManeuverVoicePromptEnabled (Action action)

Checks if voice prompts for certain maneuver is enabled.

Parameters:

  • action

    Maneuver action type to be checked.

Returns:

True if voice prompts for this maneuver type is enabled or false otherwise.

public int isTtsLanguageAvailable (Locale locale)

Get the availability of the specified language as represented by the Locale .

Parameters:

  • locale

    The Locale describing the language to be used.

Returns:

Return one of the values below:

  • android.speech.tts.TextToSpeech#LANG_AVAILABLE
  • android.speech.tts.TextToSpeech#LANG_COUNTRY_AVAILABLE
  • android.speech.tts.TextToSpeech#LANG_COUNTRY_VAR_AVAILABLE
  • android.speech.tts.TextToSpeech#LANG_MISSING_DATA
  • android.speech.tts.TextToSpeech#LANG_NOT_SUPPORTED

public void resetAllVoicePromptRules ()

Resets all distance based and time based voice announcement rules.

public boolean setManeuverVoicePromptEnabled (Action action, boolean enabled)

Enables/disables voice prompts for certain maneuver.

Parameters:

  • action

    Maneuver voice prompt to be enabled/disabled.

  • enabled

    State for maneuver voice prompt.

Returns:

True if operation was successful or false otherwise.

public void setTtsOutputFormat (TtsOutputFormat format)

Sets the TTS text output format. Default format is RAW (pure text without phonemes and escape sequences).

Parameters:

public void setVoicePromptDistanceRangeFromPreviousManeuver (RoadType roadType, VoicePromptType voicePromptType, Range distRange)

Configures voice guidance rules. Sets minimal and maximal distance (in meters) after last maneuver to announce next one.

Parameters:

public void setVoicePromptDistanceRangeToNextManeuver (RoadType roadType, VoicePromptType voicePromptType, Range distRange)

Configures voice guidance rules. Sets minimal and maximal distance (in meters) before upcoming maneuver.

Parameters:

public void setVoicePromptTimeBasedDistanceToNextManeuver (RoadType roadType, VoicePromptType voicePromptType, int distance)

Configures voice guidance rules. Sets the time based distance (in meters) before upcoming maneuver.

Parameters:

public void setVoicePromptTimeRangeFromPreviousManeuver (RoadType roadType, VoicePromptType voicePromptType, Range timeRange)

Configures voice guidance rules. Sets minimal and maximal time in seconds) after last maneuver to announce next one.

Parameters:

public void setVoicePromptTimeRangeToNextManeuver (RoadType roadType, VoicePromptType voicePromptType, Range timeRange)

Configures voice guidance rules. Sets minimal and maximal time (in seconds) before upcoming maneuver.

Parameters:

public Error setVoiceSkin (VoiceSkin skin)

Sets the voice skin id for voice Navigation.

Parameters:

Returns:

NONE if operation was successful, otherwise one of the other error codes in Error.