Members
-
essentia
-
Properties
Name Type Description this.essentiaEssentiaJS an instance of
EssentiaWASM.EssentiaJS.this.extractorTypestring 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 inputArrayFloat32Array input Float32 typed array.
Returns
Details
-
vectorToArray( inputVector ) → {Float32Array}
-
Description
Convert an input VectorFloat array into typed JS Float32Array
Parameters
Name Type Description inputVectorVectorFloat 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 audioURLstring web url or blob uri of a audio file
webAudioCtxAudioContext an instance of Web Audio API
AudioContextReturns
Details
-
audioBufferToMonoSignal( buffer ) → {Float32Array}
-
Description
Convert an AudioBuffer object to a Mono audio signal array. The audio signal is downmixed to mono using essentia
MonoMixeralgorithm 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 bufferAudioBuffer AudioBufferobject 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 sourceBufferAudioBuffer AudioBufferobject 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
extractorTypesetting.Parameters
Name Type Description audioFrameFloat32Array 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
computemethod. It throws an exception if the size of audioFrame is not equal to the pre-configured size.Parameters
Name Type Description audioSignalFloat32Array 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