类 VoiceInstructions
java.lang.Object
ai.nextbillion.kits.directions.models.DirectionsJsonObject
ai.nextbillion.kits.directions.models.VoiceInstructions
- 所有已实现的接口:
Serializable
This class provides information thats useful for properly making navigation announcements at the
correct time. Essentially, a distance and a string are given, using Turf Distance measurement
methods you can measure the users current location to the next steps maneuver point and if the
measured distance is less than the one the API provides, the announcement should be made.
- 另请参阅:
-
嵌套类概要
嵌套类修饰符和类型类说明static classThis builder can be used to set the values describing theVoiceInstructions. -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明abstract StringProvides the instruction string which was build on the server-side and can sometimes concatenate instructions together if maneuver instructions are too close to each other.static VoiceInstructions.Builderbuilder()Create a new instance of this class by using theVoiceInstructions.Builderclass.abstract DoubleThis provides the missing piece in which is needed to announce instructions at accurate times.static VoiceInstructionsCreate a new instance of this class by passing in a formatted valid JSON String.abstract StringGet the same instruction string you'd get fromannouncement()but this one includes Speech Synthesis Markup Language which helps voice synthesiser read information more humanely.abstract VoiceInstructions.BuilderConvert the currentVoiceInstructionsto its builder holding the currently assigned values.static com.google.gson.TypeAdapter<VoiceInstructions>typeAdapter(com.google.gson.Gson gson) Gson type adapter for parsing Gson to this class.从类继承的方法 ai.nextbillion.kits.directions.models.DirectionsJsonObject
toJson
-
构造器详细资料
-
VoiceInstructions
public VoiceInstructions()
-
-
方法详细资料
-
builder
Create a new instance of this class by using theVoiceInstructions.Builderclass.- 返回:
- this classes
VoiceInstructions.Builderfor creating a new instance
-
distanceAlongGeometry
This provides the missing piece in which is needed to announce instructions at accurate times. If the user is less distance away from the maneuver than what thisdistanceAlongGeometry()than, the announcement should be called.- 返回:
- double value representing the distance to next maneuver in unit meters
-
announcement
Provides the instruction string which was build on the server-side and can sometimes concatenate instructions together if maneuver instructions are too close to each other.- 返回:
- a string with the readable instructions ready to be read or displayed to a user
-
ssmlAnnouncement
Get the same instruction string you'd get fromannouncement()but this one includes Speech Synthesis Markup Language which helps voice synthesiser read information more humanely.- 返回:
- a string with the SSML instructions
-
toBuilder
Convert the currentVoiceInstructionsto its builder holding the currently assigned values. This allows you to modify a single property and then rebuild the object resulting in an updated and modifiedVoiceInstructions.- 返回:
- a
VoiceInstructions.Builderwith the same values set to match the ones defined in thisVoiceInstructions
-
typeAdapter
Gson type adapter for parsing Gson to this class.- 参数:
gson- the builtGsonobject- 返回:
- the type adapter for this class
-
fromJson
Create a new instance of this class by passing in a formatted valid JSON String.- 参数:
json- a formatted valid JSON string defining a VoiceInstructions- 返回:
- a new instance of this class defined by the values passed inside this static factory method
-