Class: AudioPane

AudioPane(audioContext, options)

An AudioPane handles audio playback, playback controls, and playback visuals.

Constructor

new AudioPane(audioContext, options)

Create an audio pane.
Parameters:
Name Type Description
audioContext Object An AudioContext.
options Object Configuration options.
Author:
  • Lawrence Fyfe
Source:

Methods

activate()

Activate this pane, allowing it to accept pointer events.
Source:

activateKeyboardInput()

Activate keyboard controls for player playing, pausing, stopping, and skipping.
Source:

addScheduledBufferPlayer()

Add the specified scheduled player.
Source:

cancelPlayIndicators()

Cancel the animation of the play indicator.
Source:

deactivate()

Deactivate this pane, preventing it from accepting pointer events.
Source:

deactivateKeyboardInput()

Deactivate keyboard controls.
Source:

deleteAllScheduledBufferPlayers()

Delete all scheduled buffer players.
Source:

deleteScheduledBufferPlayer()

Delete the scheduled player specified by its time vale.
Source:

draw()

Draw this AudioPane. Note that this pane has no visual component other than the audio playback progress indicator which only appears when the player is playing or paused.
Source:

drawPanel()

Draw the panel for this pane.
Source:

drawPlayIndicator()

Draw the animated play indicator.
Source:

erasePanel()

Erase the panel for this pane.
Source:

getDuration()

Get the duration of the player for this pane
Source:

getElapsedTime()

Get the elapsed time in seconds since the last call to this method.
Source:

getPlayerTime()

Get the total playback time of the player for this pane.
Source:

hasPlayer() → {boolean}

Determine whether this AudioPane has a player set.
Source:
Returns:
Whether a player has been added.
Type
boolean

initialize(parentElement, width, height, timeScale)

Initialize this AudioPane.
Parameters:
Name Type Description
parentElement Element The parent element.
width number The parent width.
height number The parent height.
timeScale d3.scaleLinear The time scale.
Source:

initializePanel(panelElement)

Initialize the panel for this pane, setting its parent element to the specified element.
Parameters:
Name Type Description
panelElement element The parent element.
Source:

isPlaying() → {boolean}

Determines whether the player is playing or paused.
Source:
Returns:
True if the player is playing or paused, false otherwise
Type
boolean

(async) isReady()

Determines whether a buffer has been decoded and is ready to play.
Source:

lower()

Lower this pane to the bottom of the list of panes in its containing TimeFrame.
Source:

onPlayerEnded()

Run this method when the player for this pane has ended.
Source:

pause()

Pause the player for this AudioPane.
Source:

play()

Play the player for this AudioPane.
Source:

playOrPause()

Play the player if it's stopped or paused; pause otherwise.
Source:

playScheduledBufferPlayers()

Play scheduled buffer players. Note that only buffer players scheduled after the current playback time will play.
Source:

raise()

Raise this pane to the top of the list of panes in its containing TimeFrame.
Source:

resetAudioButtons()

Reset the built-in control buttons to their starting state.
Source:

resetTimeRange()

Resets the time range to start at zero and end at the duration of the player.
Source:

setAudioButtonsToPlaying()

Set the built-in control buttons to a playing state.
Source:

setPlayButtonToPaused()

Set the built-in control buttons to a paused state.
Source:

setTimeRange(start, stop)

Set the time range for playback.
Parameters:
Name Type Description
start number The start time.
stop number The end time.
Source:

skip()

Skip player playback to the specified time. If the player is playing, skip to that time and keep playing.
Source:

skipToNextScheduledBufferPlayer()

Skip to the next scheduled player.
Source:

skipToPreviousScheduledBufferPlayer()

Skip to the previously scheduled player.
Source:

stop()

Stop player. This will cancel the play indicator, stop any buffers scheduled after the stopping time, and reset the control buttons.
Source:

stopScheduledBufferPlayers()

Stop all scheduled buffer players.
Source:

switchScheduledAudio()

Switch playback of scheduled buffers on and off.
Source: