Meyda stores a reference to the relevant audio context here for use inside the Web Audio API.
The length of each buffer that Meyda will extract audio on. When recieving input via the Web Audio API, the Script Processor Node chunks incoming audio into arrays of this length. Longer buffers allow for more precision in the frequency domain, but increase the amount of time it takes for Meyda to output a set of audio features for the buffer. You can calculate how many sets of audio features Meyda will output per second by dividing the buffer size by the sample rate. If you're using Meyda for visualisation, make sure that you're collecting audio features at a rate that's faster than or equal to the video frame rate you expect.
The number of bands to divide the spectrum into for the Chroma feature extractor. 12 is the standard number of semitones per octave in the western music tradition, but Meyda can use an arbitrary number of bands, which can be useful for microtonal music.
The number of Mel bands to use in the Mel Frequency Cepstral Co-efficients feature extractor
The number of MFCC co-efficients that the MFCC feature extractor should return
The number of samples per second of the incoming audio. This affects feature extraction outside of the context of the Web Audio API, and must be set accurately - otherwise calculations will be off.
Specify the windowing function to apply to the buffer before the transformation from the time domain to the frequency domain is performed
The default windowing function is the hanning window.
Extract an audio feature from a buffer
Unless meyda.windowingFunction
is set otherwise, extract
will
internally apply a hanning window to the buffer prior to conversion into
the frequency domain.
the feature you want to extract
An array of numbers that represents the signal. It should be of length
meyda.bufferSize
Features
List available audio feature extractors. Return format provides the key to be used in selecting the extractor in the extract methods
Apply a windowing function to a signal
Generated using TypeDoc
Meyda is a library for extracting audio features from an audio signal.
The primary entry points are extract for audio feature extraction on raw signals you have in memory, and createMeydaAnalyzer, which provides a MeydaAnalyzer object that can be used to extract features on a Web Audio API AudioNode. The latter is only supported on web targets, though if you're using the Web Audio API in a non-web target, we'd love to hear from you.
We also expose listAvailableFeatureExtractors which returns a list of the available feature extractors, and windowing, which lets you apply a windowing function to your signal outside of Meyda.
We existed long before esmodules, so our backwards compatible API may seem unusual. We export a default object, with read/write fields that control various parameters of the audio feature extraction process. We're working on a new interface, check out #257 for more information.