Class: Instrument

Highcharts. Instrument

new Instrument(options)

The Instrument class. Instrument objects represent an instrument capable of playing a certain pitch for a specified duration.

参数:
名字 类型 详情
options Highcharts.InstrumentOptionsObject

Options for the instrument instance.

依赖:
  • module:modules/sonification
在线示例

依赖

  • module:modules/sonification

方法

copy( [options])

Return a copy of an instrument. Only one instrument instance can play at a time, so use this to get a new copy of the instrument that can play alongside it. The new instrument copy will receive a new ID unless one is supplied in options.

参数:
名字 类型 特质 详情
options Highcharts.InstrumentOptionsObject <可选>

Options to merge in for the copy.

返回值:
Highcharts.Instrument .

A new Instrument instance with the same options.

mute()

Mute an instrument that is playing. If the instrument is not currently playing, this function does nothing.

play(options)

Play the instrument according to options.

参数:
名字 类型 详情
options Highcharts.InstrumentPlayOptionsObject

Options for the playback of the instrument.

返回值:
在线示例

stop(immediately [, onStopped] [, callbackData])

Stop the instrument playing.

参数:
名字 类型 特质 详情
immediately boolean

Whether to do the stop immediately or fade out.

onStopped function <可选>

Callback function to be called when the stop is completed.

callbackData * <可选>

Data to send to the onEnd callback functions.

返回值: