Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Create the audio input stream (audio)
this.audioStream = this.audioContext.createMediaStreamSource(stream)
// Connect the audio stream to the analyser (this is a passthru) (audio->(analyser))
this.audioStream.connect(this.analyserNode)
// Connect the audio stream to the gain node (audio->(analyser)->gain)
this.audioStream.connect(this.gainNode)
// Connect the gain node to the output (audio->(analyser)->gain->destination)
this.gainNode.connect(this.audioContext.destination)
// Set up Meyda
// eslint-disable-next-line new-cap
this.meyda = new Meyda.createMeydaAnalyzer({
audioContext: this.audioContext,
source: this.audioStream,
bufferSize: 512,
windowingFunction: 'rect'
})
// Tell the rest of the script we're all good.
this.mediaSourcesInited = true
resolve(ids)
})
}
this.gainNode.gain.value = 0;
// Create the audio input stream (audio)
this.audioStream = this.audioContext.createMediaStreamSource(stream);
// Connect the audio stream to the analyser (this is a passthru) (audio->(analyser))
this.audioStream.connect(this.analyserNode);
// Connect the audio stream to the gain node (audio->(analyser)->gain)
this.audioStream.connect(this.gainNode);
// Connect the gain node to the output (audio->(analyser)->gain->destination)
this.gainNode.connect(this.audioContext.destination);
// Set up Meyda
this.meyda = new Meyda.createMeydaAnalyzer({
audioContext: this.audioContext,
source: this.audioStream,
bufferSize: 512,
windowingFunction: 'rect'
});
// Tell the rest of the script we're all good.
this.mediaSourcesInited = true;
}