Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MeydaAnalyzer

Meyda's interface to the Web Audio API. MeydaAnalyzer abstracts an API on top of the Web Audio API's ScriptProcessorNode, running the Meyda audio feature extractors inside that context.

MeydaAnalyzer's constructor should not be called directly - MeydaAnalyzer objects should be generated using the createMeydaAnalyzer factory function in the main Meyda class.

Options are of type MeydaAnalyzerOptions.

example
const analyzer = Meyda.createMeydaAnalyzer({
"audioContext": audioContext,
"source": source,
"bufferSize": 512,
"featureExtractors": ["rms"],
"inputs": 2,
"numberOfMFCCCoefficients": 20
"callback": features => {
levelRangeElement.value = features.rms;
}
});

Hierarchy

  • MeydaAnalyzer

Index

Methods

get

setChannel

  • setChannel(channel: number): void
  • Set the channel of the audio node for Meyda to listen to

    example
    analyzer.setChannel(0);
    

    Parameters

    • channel: number

      the index of the channel on the input audio node for Meyda to listen to.

    Returns void

setSource

  • setSource(source: AudioNode): void
  • Set the Audio Node for Meyda to listen to.

    example
    analyzer.setSource(audioSourceNode);
    

    Parameters

    • source: AudioNode

      The Audio Node for Meyda to listen to

    Returns void

start

  • Start feature extraction The audio features will be passed to the callback function that was defined in the MeydaOptions that were passed to the factory when constructing the MeydaAnalyzer.

    example
    analyzer.start('chroma');
    

    Parameters

    Returns void

stop

  • stop(): void

Generated using TypeDoc