Home Reference Source
import MorseAdaptiveListener from 'morse-pro/src/morse-pro-listener-adaptive.js'
public class | source

MorseAdaptiveListener

Extends:

MorseListener → MorseAdaptiveListener

Extension of the MorseListener class which automatically adapts to the dominant frequency.

Constructor Summary

Public Constructor
public

constructor(bufferDuration: number)

Parameters are all the same as the MorseListener class with the addition of the bufferDuration.

Member Summary

Public Members
public
public

buffer: *[]

public
public
public
public

Method Summary

Public Methods
public

@access: private

Inherited Summary

From class MorseListener
public set

Set the minimum and maximum frequency filter values to be closely surrounding a specific frequency.

public get
public set

Set the maximum threshold on the frequency filter.

public get
public set

Set the minimum threshold on the frequency filter.

public get
public set

Set the maximum threshold on the volume filter.

public get
public set

Set the minimum threshold on the volume filter.

public get
public set

Set the threshold used to determine if an anlaysed region has sufficient sound to be "on".

public
public
public

decoder: *

public

defaults: {"fftSize": number, "volumeFilterMin": *, "volumeFilterMax": *, "frequencyFilterMin": number, "frequencyFilterMax": number, "volumeThreshold": number}

public

fftSize: *

public
public
public
public
public
public

input: *

public

jsNode: *

public
public

maxFreq: *

public
public
public
public
public
private
private
private
public
public

fileErrorCallback(error: *)

public

fileLoadCallback(audioBuffer: *)

public

flush(on: *)

Flush the current ticks to the decoder.

public
public

@access: private

public

Load audio data from an ArrayBuffer.

public

micErrorCallback(error: *)

public
public

Play a loaded audio file (through speakers) and decode it.

public

This ScriptProcessorNode is called when it is full, we then actually look at the data in the analyserNode node to measure the volume in the frequency band of interest.

public

recordOnOrOff(soundIsOn: *)

Called each tick with whether the sound is judged to be on or off.

public

spectrogramCallback(jsonData: *)

public

Start the decoder listening to the microphone.

public

stop()

Stop listening.

public

volumeFilterCallback(jsonData: *)

public

Public Constructors

public constructor(bufferDuration: number) source

Parameters are all the same as the MorseListener class with the addition of the bufferDuration.

Override:

MorseListener#constructor

Params:

NameTypeAttributeDescription
bufferDuration number
  • optional
  • default: 500

How long in ms to look back to find the frequency with the maximum volume.

Public Members

public averageVolume: * source

public buffer: *[] source

public bufferIndex: number source

public bufferSize: * source

public frequencyFilter: * source

Set the minimum and maximum frequency filter values to be closely surrounding a specific frequency.

Override:

MorseListener#frequencyFilter

public lockFrequency: boolean source

Public Methods

public processSound() source

@access: private

Override:

MorseListener#processSound