Class 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
    • Constructor Detail

      • DefaultSpeechOptions

        public DefaultSpeechOptions()
    • 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 with time, and potentially point and value 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, and valueInterval 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 with time, and potentially point and value 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, and valueInterval 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.
        If a function is used, it should return the desired value for the audio parameter. The function is called for each audio event to be played, and receives a context object parameter with time, and potentially point and value depending on the track. point is available if the audio event is related to a data point, and value is available if the track is used for a context track using valueInterval.
      • 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.
        If a function is used, it should return the desired value for the audio parameter. The function is called for each audio event to be played, and receives a context object parameter with time, and potentially point and value depending on the track. point is available if the audio event is related to a data point, and value is available if the track is used for a context track using valueInterval.
      • 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" for speech tracks.

        Default: "speech"

      • setType

        public void setType​(String type)
        Sets the type of track. Always "instrument" for instrument tracks, and "speech" for speech tracks.