Home Reference Source Repository
import MorsePlayerXAS from 'morse-pro/src/morse-pro-player-xas.js'
public class | source

MorsePlayerXAS

Web browser sound player for older browsers, using XAudioJS by Grant Galitz (https://github.com/taisel/XAudioJS).

Example:

import MorseCWWave from 'morse-pro-cw-wave';
import MorsePlayerXAS from 'morse-pro-player-xas';
// make sure XAudioJS is loaded
var morseCWWave = new MorseCWWave();
morseCWWave.translate("abc");
var morsePlayerXAS = new MorsePlayerXAS(XAudioServer);
morsePlayerXAS.load(morseCWWave);
morsePlayerXAS.playFromStart();

Constructor Summary

Public Constructor
public

constructor(xaudioServerClass: Object)

Member Summary

Public Members
public
public
public get
public
public get

gain: number: *

public get
public
public
public

sample: *

public
public
public
public set

Set the volume for the player

public get
Private Members
private
private
private

_volume: *

Method Summary

Public Methods
public

hasError(): *

public

load(sequence: Object)

Load timing sequence, replacing any existing sequence.

public
public

stop()

Public Constructors

public constructor(xaudioServerClass: Object) source

Params:

NameTypeAttributeDescription
xaudioServerClass Object

the XAudioServer class

Public Members

public XAudioServerClass: * source

public audioServer: * source

public get audioType: * source

public endPadding: * source

public get gain: number: * source

Return:

number

the current gain [0,1]

public get isPlaying: * source

public morseCWWave: * source

public noAudio: boolean source

public sample: * source

public samplePos: * source

public sampleRate: number source

public startPadding: * source

public set volume(v: number) source

Set the volume for the player

public get volume: number: * source

Return:

number

the current volume [0,1]

Private Members

private _gain: number source

private _isPlaying: boolean source

private _volume: * source

Public Methods

public hasError(): * source

Return:

*

public load(sequence: Object) source

Load timing sequence, replacing any existing sequence. If this.endPadding is non-zero then an appropriate pause is added to the end. Uses the frequency defined in this.cwWave

Params:

NameTypeAttributeDescription
sequence Object

the sequence to play.

sequence.timings number[]

list of millisecond timings; +ve numbers are beeps, -ve numbers are silence.

public playFromStart() source

public stop() source