Home Reference Source Repository
import MorsePlayerWAALight from 'morse-pro/src/morse-pro-player-waa-light.js'
public class | source

MorsePlayerWAALight

Extends:

MorsePlayerWAA → MorsePlayerWAALight

Constructor Summary

Public Constructor
public

constructor(params: Object)

Member Summary

Public Members
public get
public

jsNode: *

public
Private Members
private
private

Method Summary

Public Methods
public

muteLight(mute: *)

public
public
Private Methods
private

Set up the audio graph, connecting the splitter node to a JSNode in order to analyse the waveform

private

_off()

private

_on()

private

_processSound(event: *)

Inherited Summary

From class MorsePlayerWAA
public get
public get
public set
public get

gain: number: *

public get
public get
public get

Return the index of the next note in the sequence to be scheduled.

public get
public set

playMode(mode: String)

Set the play mode (one of 'sine' and 'sample').

public get
public set

Set the volume for the player.

public
public
public
public

isNote: *[]

public
public
public
public
public
public
public
public
private

_cTimings: *[]

private
private
private
private
private
private
private
private
private
private
private

_queue: *[]

private
private
private
private

_tZero: *

private

_timer: *

private
private

_volume: *

public
public

load(sequence: Object)

Load timing sequence, replacing any existing sequence.

public

loadNext(sequence: Object)

this method was deprecated. - use queue() instead

Load timing sequence which will be played when the current sequence is completed (current queue is deleted).

public

Mutes or unmutes the audio (leaving the volume setting alone)

public

pause()

Pause playback (resume with play())

public

play()

Starts or resumes playback of the loaded timing sequence.

public

Plays the loaded timing sequence from the start, regardless of whether playback is ongoing or paused.

public

queue(sequence: Object)

Queue up a timing sequence (add to the end of the queue)

public

Called at the end of the last beep of a sequence.

public

Called at the point of the last notes of a sequence being scheduled.

public

Called to coincide with the start of the first note in a sequence.

public

Called when all sounds have definitely stopped.

public

stop()

Stop playback (calling play() afterwards will start from the beginning)

private

Set up the audio graph.

private

Schedule notes that start before now + lookAheadTime.

private

_stop()

Internal clean stop that doesn't destroy audiocontext

Public Constructors

public constructor(params: Object) source

Override:

MorsePlayerWAA#constructor

Params:

NameTypeAttributeDescription
params Object

lots of optional parameters.

params.defaultFrequency number

fallback frequency (Hz) to use if the loaded sequence does not define any.

params.startPadding number

number of ms to wait before playing first note of initial sequence.

params.endPadding number

number of ms to wait at the end of a sequence before playing the next one (or looping).

params.volume number

volume of Morse. Takes range [0,1].

params.sequenceStartCallback function()

function to call each time the sequence starts.

params.sequenceEndingCallback function()

function to call when the sequence is nearing the end.

params.sequenceEndCallback function()

function to call when the sequence has ended.

params.soundStoppedCallback function()

function to call when the sequence stops.

params.soundOnCallback function()

function to call when a note starts.

params.soundOffCallback function()

function to call when a note stops.

params.onSample string

URL of the sound file to play at the start of a note.

params.offSample string

URL of the sound file to play at the end of a note.

params.playMode string

play mode, either "sine" or "sample".

Public Members

public get audioType: number: number source

Override:

MorsePlayerWAA#audioType

Return:

number

representing this audio player type: 5

public jsNode: * source

public muteLightNode: * source

Private Members

private _count: number source

private _wasOn: boolean source

Public Methods

public muteLight(mute: *) source

Params:

NameTypeAttributeDescription
mute *

public soundOffCallback() source

public soundOnCallback() source

Private Methods

private _initialiseAudio() source

Set up the audio graph, connecting the splitter node to a JSNode in order to analyse the waveform

Override:

MorsePlayerWAA#_initialiseAudio

private _off() source

private _on() source

private _processSound(event: *) source

Params:

NameTypeAttributeDescription
event *