meSpeak.js Audio Anaylser Demo

This is a simple demonstration of meSpeak.getAudioAnalyser(), which returns a Web Audio AnalyserNode. Here, we draw an oscilloscope display of the waveform generated by meSpeak.speak().

AnalyserNode = meSpeak.getAudioAnalyser();

Returns an AnalyserNode, providing the signal of the first global output node.
This is before filtering, but after individual volume (gain) is applied.

Compare developer.mozilla.org/en-US/docs/Web/API/AnalyserNode.


Usage:

var analyserNode = meSpeak.getAudioAnalyser();

analyserNode.fftSize = 2048;
var bufferLength = analyserNode.frequencyBinCount;
var dataArray = new Uint8Array(bufferLength);

function analyse() {
    analyserNode.getByteTimeDomainData(dataArray);
    ...
    requestAnimationFrame(draw);
}

analyse();