Members
-
essentia
-
Properties
Name Type Description this.essentia
EssentiaJS an instance of
EssentiaWASM.EssentiaJS
.this.extractorType
string type of the choosen extractor (eg. 'muscinn', 'vggish' or 'tempocnn').
Details
Methods
-
arrayToVector( inputArray ) → {VectorFloat}
-
Description
Convert a typed JS Float32Array into VectorFloat type.
Parameters
Name Type Description inputArray
Float32Array input Float32 typed array.
Returns
Details
-
vectorToArray( inputVector ) → {Float32Array}
-
Description
Convert an input VectorFloat array into typed JS Float32Array
Parameters
Name Type Description inputVector
VectorFloat input VectorFloat array
Returns
Details
-
<async> getAudioBufferFromURL( audioURL, webAudioCtx ) → {Promise.<AudioBuffer>}
-
Description
Decode and returns the audio buffer from an given audio url or blob uri using Web Audio API. (NOTE: This doesn't work on Safari browser)
Parameters
Name Type Description audioURL
string web url or blob uri of a audio file
webAudioCtx
AudioContext an instance of Web Audio API
AudioContext
Returns
Details
-
audioBufferToMonoSignal( buffer ) → {Float32Array}
-
Description
Convert an AudioBuffer object to a Mono audio signal array. The audio signal is downmixed to mono using essentia
MonoMixer
algorithm if the audio buffer has 2 channels of audio. Throws an expection if the input AudioBuffer object has more than 2 channels of audio.Parameters
Name Type Description buffer
AudioBuffer AudioBuffer
object decoded from an audio file.Returns
Details
-
downsampleAudioBuffer( sourceBuffer ) → {Float32Array}
-
Description
Downsample a audio buffer to a target audio sample rate using the Web Audio API NOTE: This method will only works on web-browsers which supports the Web Audio API.
Parameters
Name Type Description sourceBuffer
AudioBuffer AudioBuffer
object decoded from an audio file.Returns
Details
-
compute( audioFrame ) → {EssentiaTFInputExtractorOutput}
-
Description
This method compute the pre-configured features for a given audio signal frame. It throws an exception if the size of audioFrame is not equal to the pre-configured audioFrame size for the selected
extractorType
setting.Parameters
Name Type Description audioFrame
Float32Array a frame of audio signal as Float32 typed JS array.
Returns
Details
-
computeFrameWise( audioSignal, hopSize? ) → {EssentiaTFInputExtractorOutput}
-
Description
This method compute the pre-configured feature for a whole audio signal. It is a wrapper on top of the
compute
method. It throws an exception if the size of audioFrame is not equal to the pre-configured size.Parameters
Name Type Description audioSignal
Float32Array decoded audio signal as Float32 typed JS array.
hopSize?
number optional param for specifying hopSize for overlapping-frames. By default use none.
Returns
Details
-
"delete"() → {null}
-
Description
Delete essentia session and frees the memory.
Returns
Details
-
shutdown() → {null}
-
Description
This method shutdown all the instance of Essentia WASM and frees the memory. NOTE: If you want to just free the memory of the pre-configured extractor, use
this.extractor.delete()
instead.Returns
Details