MorseCWWave
Extends:
Class to create sine-wave samples of standard CW Morse.
Example:
import MorseCWWave from 'morse-pro-cw-wave';
var morseCWWave = new MorseCWWave();
morseCWWave.translate("abc");
var sample = morseCWWave.getSample();
Static Method Summary
Static Public Methods | ||
public static |
getSampleGeneral(timings: number[], frequency: number, sampleRate: number, endPadding: number): number[] Get a sample waveform, not using Web Audio API (synchronous). |
Constructor Summary
Public Constructor | ||
public |
constructor(frequency: number, sampleRate: number) |
Member Summary
Public Members | ||
public |
|
|
public |
|
Method Summary
Public Methods | ||
public |
Get a sample waveform, not using Web Audio API (synchronous). |
|
public |
getWAASample(endPadding: number): Promise(number[]) Get a sample waveform using Web Audio API (asynchronous). |
Inherited Summary
From class MorseMessage | ||
public |
hasError: * |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
useProsigns: * |
|
public |
Clear all the errors from the morse and message. |
|
public |
|
From class MorseCW | ||
public static |
getTimingsGeneral(dit: number, dah: number, ditSpace: number, charSpace: number, wordSpace: number, morse: string): number[] Return an array of millisecond timings. |
|
public get |
|
|
public set |
Set the Farnsworth WPM speed. |
|
public get |
Get the length of the space between words in ms. |
|
public get |
|
|
public set |
Set the WPM speed. |
|
private |
_fwpm: * |
|
private |
_wpm: * |
|
public |
getDuration(): * Get the total duration of the message in ms 8 @return {number} |
|
public |
getTimings(): number[] Return an array of millisecond timings. |
Static Public Methods
public static getSampleGeneral(timings: number[], frequency: number, sampleRate: number, endPadding: number): number[] source
Get a sample waveform, not using Web Audio API (synchronous).
Params:
Name | Type | Attribute | Description |
timings | number[] | millisecond timings, +ve numbers representing sound, -ve for no sound (+ve/-ve can be in any order) |
|
frequency | number | frequency of sound in Hz. |
|
sampleRate | number | sample rate in Hz. |
|
endPadding | number |
|
how much silence in ms to add to the end of the waveform. |
Public Constructors
Public Methods
public getSample(endPadding: number): number[] source
Get a sample waveform, not using Web Audio API (synchronous).
Params:
Name | Type | Attribute | Description |
endPadding | number |
|
how much silence in ms to add to the end of the waveform. |
public getWAASample(endPadding: number): Promise(number[]) source
Get a sample waveform using Web Audio API (asynchronous).
Params:
Name | Type | Attribute | Description |
endPadding | number |
|
how much silence in ms to add to the end of the waveform. |
Return:
Promise(number[]) | a Promise resolving to an array of floats in range [-1, 1] representing the wave-form. |