new SnrComputer(initPath)
SnrComputer constructor
Parameters:
Name | Type | Description |
---|---|---|
initPath |
string | Path to the initialization folder containing the required binaries and configuration files |
Methods
clone() → {SnrComputer}
Returns a new handle for this object to optimize memory consumption
The object will be disposed only after delete() is called for original object and for each of clones
Returns:
New handle of this object
- Type
- SnrComputer
computeFromFromFile(wavFile) → {number}
Computes SNR for WAV file
Parameters:
Name | Type | Description |
---|---|---|
wavFile |
string | Path to WAV file |
Returns:
Signal-to-noise ratio (SNR) in dB
- Type
- number
computeFromFromFloatSamples(floatSamples, sampleRate) → {number}
Computes SNR for float audio samples
Parameters:
Name | Type | Description |
---|---|---|
floatSamples |
Float32Array | Array containing float samples |
sampleRate |
number | Sample rate |
Returns:
Signal-to-noise ratio (SNR) in dB
- Type
- number
computeFromFromPcm16Bytes(bytes, sampleRate) → {number}
Computes SNR for PCM16 audio bytes
Parameters:
Name | Type | Description |
---|---|---|
bytes |
Uint8Array | Array containing PCM16 bytes |
sampleRate |
number | Sample rate |
Returns:
Signal-to-noise ratio (SNR) in dB
- Type
- number
computeFromFromPcm16Samples(pcm16Samples, sampleRate) → {number}
Computes SNR for PCM16 audio samples
Parameters:
Name | Type | Description |
---|---|---|
pcm16Samples |
Int16Array | Array containing PCM16 samples |
sampleRate |
number | Sample rate |
Returns:
Signal-to-noise ratio (SNR) in dB
- Type
- number
delete()
Manually signals that the object is no more needed. Strongly recommended to call this method explicitly.
isDeleted() → {boolean}
Whether delete method was called (and the object can't be used) or not
Returns:
Whether delete method was called (and the object can't be used) or not
- Type
- boolean