import MorseAdaptiveListener from 'morse-pro/src/morse-pro-listener-adaptive.js'
MorseAdaptiveListener
Extends:
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 |
bufferSize: * |
|
public |
|
|
public |
|
Method Summary
Private Methods | ||
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 |
analyserNode: * |
|
public |
audioContext: * |
|
public |
decoder: * |
|
public |
defaults: {"fftSize": number, "volumeFilterMin": *, "volumeFilterMax": *, "frequencyFilterMin": number, "frequencyFilterMax": number, "volumeThreshold": number} |
|
public |
fftSize: * |
|
public |
|
|
public |
|
|
public |
freqBins: * |
|
public |
freqStep: * |
|
public |
|
|
public |
input: * |
|
public |
jsNode: * |
|
public |
|
|
public |
maxFreq: * |
|
public |
|
|
public |
sampleRate: * |
|
public |
sourceNode: * |
|
public |
|
|
public |
timeStep: * |
|
private |
|
|
private |
|
|
private |
|
|
public |
|
|
public |
fileErrorCallback(error: *) |
|
public |
fileLoadCallback(audioBuffer: *) |
|
public |
flush(on: *) Flush the current ticks to the decoder. |
|
public |
frequencyFilterCallback(jsonData: *) |
|
public |
loadArrayBuffer(arrayBuffer: ArrayBuffer) Load audio data from an ArrayBuffer. |
|
public |
micErrorCallback(error: *) |
|
public |
|
|
public |
Play a loaded audio file (through speakers) and decode it. |
|
public |
spectrogramCallback(jsonData: *) |
|
public |
Start the decoder listening to the microphone. |
|
public |
stop() Stop listening. |
|
public |
volumeFilterCallback(jsonData: *) |
|
public |
volumeThresholdCallback(volume: *) |
|
private |
|
|
private |
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. |
|
private |
recordOnOrOff(soundIsOn: *) Called each tick with whether the sound is judged to be on or off. |
Public Constructors
public constructor(bufferDuration: number) source
Parameters are all the same as the MorseListener class with the addition of the bufferDuration.
Override:
MorseListener#constructorParams:
Name | Type | Attribute | Description |
bufferDuration | number |
|
How long in ms to look back to find the frequency with the maximum volume. |
Public Members
public averageVolume: * source
public buffer: *[] source
public bufferSize: * source
public frequencyFilter: * source
Set the minimum and maximum frequency filter values to be closely surrounding a specific frequency.
Override:
MorseListener#frequencyFilterPrivate Methods
private processSound() source
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. We don't actually use the input or output of the ScriptProcesorNode.