Class DefaultSpeechOptions
- java.lang.Object
-
- org.zkoss.chart.Optionable
-
- org.zkoss.chart.DefaultSpeechOptions
-
- All Implemented Interfaces:
Serializable
,OptionDataListener
,org.zkoss.json.JSONAware
public class DefaultSpeechOptions extends Optionable
Default sonification options for all speech tracks.If specific options are also set on individual tracks or per series, those will override these options.
- Since:
- 11.2.0.0
- Author:
- Jamson Chan
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.zkoss.chart.Optionable
NOT_NULL_VALUE, options
-
-
Constructor Summary
Constructors Constructor Description DefaultSpeechOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ActiveWhen
getActiveWhen()
Returns the ActiveWhen object.String
getLanguage()
Returns the language to speak in for speech tracks, as an IETF BCP 47 language tag.Mapping
getMapping()
Returns the Mapping object.PointGrouping
getPointGrouping()
Returns the options for point grouping, specifically for instrument tracks.String
getPreferredVoice()
Returns the name of the voice synthesis to prefer for speech tracks.String
getType()
Returns the type of track.boolean
isShowPlayMarker()
Returns whether to show play marker (tooltip and/or crosshair) for a track.void
setActiveWhen(ActiveWhen activeWhen)
Sets the ActiveWhen object.void
setLanguage(String language)
Sets the language to speak in for speech tracks, as an IETF BCP 47 language tag.void
setMapping(Mapping mapping)
Sets the Mapping object.void
setPointGrouping(PointGrouping pointGrouping)
Sets the options for point grouping, specifically for instrument tracks.void
setPreferredVoice(String preferredVoice)
Sets the name of the voice synthesis to prefer for speech tracks.void
setShowPlayMarker(Boolean showPlayMarker)
Sets whether to show play marker (tooltip and/or crosshair) for a track.void
setType(String type)
Sets the type of track.-
Methods inherited from class org.zkoss.chart.Optionable
addExtraAttr, addOptionDataListener, clearOptonDataListener, clone, containsKey, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, getAttr, getAttr, getClientState, getExtraAttr, merge, onChange, removeExtraAttr, removeKey, removeOptionDataListener, setAttr, setAttr, setAttr, setAttr, toJSONString, toString
-
-
-
-
Method Detail
-
getActiveWhen
public ActiveWhen getActiveWhen()
Returns the ActiveWhen object.Define a condition for when a track should be active and not.
Can either be a function callback or a configuration object.
If a function is used, it should return a
boolean
for whether or not the track should be active. The function is called for each audio event, and receives a parameter object withtime
, and potentiallypoint
andvalue
properties depending on the track.point
is available if the audio event is related to a data point.value
is available if the track is used as a context track, andvalueInterval
is used.
-
setActiveWhen
public void setActiveWhen(ActiveWhen activeWhen)
Sets the ActiveWhen object.Define a condition for when a track should be active and not.
Can either be a function callback or a configuration object.
If a function is used, it should return a
boolean
for whether or not the track should be active. The function is called for each audio event, and receives a parameter object withtime
, and potentiallypoint
andvalue
properties depending on the track.point
is available if the audio event is related to a data point.value
is available if the track is used as a context track, andvalueInterval
is used.
-
getLanguage
public String getLanguage()
Returns the language to speak in for speech tracks, as an IETF BCP 47 language tag.Default:
"en-US"
-
setLanguage
public void setLanguage(String language)
Sets the language to speak in for speech tracks, as an IETF BCP 47 language tag.
-
getMapping
public Mapping getMapping()
Returns the Mapping object.Mapping options for the audio parameters.
All parameters can be either:
- A string, referencing a point property to map to.
- A number, setting the value of the audio parameter directly.
- A callback function, returning the value programmatically.
- An object defining detailed configuration of the mapping.
-
setMapping
public void setMapping(Mapping mapping)
Sets the Mapping object.Mapping options for the audio parameters.
All parameters can be either:
- A string, referencing a point property to map to.
- A number, setting the value of the audio parameter directly.
- A callback function, returning the value programmatically.
- An object defining detailed configuration of the mapping.
-
getPointGrouping
public PointGrouping getPointGrouping()
Returns the options for point grouping, specifically for instrument tracks.
-
setPointGrouping
public void setPointGrouping(PointGrouping pointGrouping)
Sets the options for point grouping, specifically for instrument tracks.
-
getPreferredVoice
public String getPreferredVoice()
Returns the name of the voice synthesis to prefer for speech tracks.If not available, falls back to the default voice for the selected language.
Different platforms provide different voices for web speech synthesis.
Default:
null
-
setPreferredVoice
public void setPreferredVoice(String preferredVoice)
Sets the name of the voice synthesis to prefer for speech tracks.If not available, falls back to the default voice for the selected language.
Different platforms provide different voices for web speech synthesis.
-
isShowPlayMarker
public boolean isShowPlayMarker()
Returns whether to show play marker (tooltip and/or crosshair) for a track.Default:
true
-
setShowPlayMarker
public void setShowPlayMarker(Boolean showPlayMarker)
Sets whether to show play marker (tooltip and/or crosshair) for a track.
-
getType
public String getType()
Returns the type of track. Always"instrument"
for instrument tracks, and "speech" forspeech
tracks.Default:
"speech"
-
setType
public void setType(String type)
Sets the type of track. Always"instrument"
for instrument tracks, and "speech" forspeech
tracks.
-
-