MorsePlayerWAA
Direct Subclass:
Web browser sound player using Web Audio API.
Example:
import MorseCWWave from 'morse-pro-cw-wave';
import MorsePlayerWAA from 'morse-pro-player-waa';
var morseCWWave = new MorseCWWave();
morseCWWave.translate("abc");
var morsePlayerWAA = new MorsePlayerWAA();
morsePlayerWAA.loadCWWave(morseCWWave);
morsePlayerWAA.playFromStart();
Constructor Summary
Public Constructor | ||
public |
constructor(sequenceStartCallback: function(), sequenceEndingCallback: function(), soundStoppedCallback: function()) |
Member Summary
Public Members | ||
public |
audioContext: * |
|
public |
|
|
public get |
|
|
public |
|
|
public |
frequency: * |
|
public |
gainNode: * |
|
public |
isNote: *[] |
|
public get |
|
|
public get |
|
|
public |
|
|
public |
lowPassNode: * |
|
public get |
Return the index of the next note in the sequence to be scheduled. |
|
public |
|
|
public |
|
|
public |
splitterNode: * |
|
public |
|
|
public |
upNext: * |
|
public get |
|
|
public set |
Set the volume for the player |
Private Members | ||
private |
_cTimings: *[] |
|
private |
|
|
private |
|
|
private |
|
|
private |
|
|
private |
|
|
private |
|
|
private |
|
|
private |
_startTimer: * |
|
private |
_stopTimer: * |
|
private |
_tZero: * |
|
private |
_timer: * |
|
private |
|
|
private |
|
Method Summary
Public Methods | ||
public |
|
|
public |
Load timing sequence, replacing any existing sequence. |
|
public |
loadCWWave(cwWave: Object) Convenience method to help playing directly from a MorseCWWave instance. |
|
public |
Load timing sequence which will be played when the current sequence is completed (only one sequence is queued). |
|
public |
loadNextCWWave(cwWave: Object) Convenience method to help playing directly from a MorseCWWave instance. |
|
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 |
|
|
public |
|
|
public |
|
|
public |
stop() Stop playback (calling play() afterwards will start from the beginning) |
Private Methods | ||
private |
Set up the audio graph @access: private |
|
private |
Schedule notes that start before now + lookAheadTime. |
Public Constructors
Public Members
public audioContext: * source
public audioContextClass: * source
public frequency: * source
public gainNode: * source
public isNote: *[] source
public get isPlaying: boolean: * source
Return:
boolean | whether a sequence is being played or not (still true even when paused); becomes false when stop is used |
public lowPassNode: * source
public get nextNote: number: * source
Return the index of the next note in the sequence to be scheduled. Useful if the sequence has been paused.
public sequenceLength: * source
public splitterNode: * source
public upNext: * source
Private Members
private _cTimings: *[] source
private _soundEndTime: * source
private _startTimer: * source
private _stopTimer: * source
private _tZero: * source
private _timer: * source
Public Methods
public load(timings: number[]) source
Load timing sequence, replacing any existing sequence. If endPadding is non-zero then an appropriate pause is added to the end.
Params:
Name | Type | Attribute | Description |
timings | number[] | list of millisecond timings; +ve numbers are beeps, -ve numbers are silence |
public loadCWWave(cwWave: Object) source
Convenience method to help playing directly from a MorseCWWave instance. Uses the CWWave timings and frequency.
Params:
Name | Type | Attribute | Description |
cwWave | Object | a MorseCWWave instance |
public loadNext(timings: number[]) source
Load timing sequence which will be played when the current sequence is completed (only one sequence is queued).
Params:
Name | Type | Attribute | Description |
timings | number[] | list of millisecond timings; +ve numbers are beeps, -ve numbers are silence |
public loadNextCWWave(cwWave: Object) source
Convenience method to help playing directly from a MorseCWWave instance. Uses the CWWave timings.
Params:
Name | Type | Attribute | Description |
cwWave | Object | a MorseCWWave instance |
public playFromStart() source
Plays the loaded timing sequence from the start, regardless of whether playback is ongoing or paused.