Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
initAudio() {
console.log('initAudio M♩D♩Sounds');
if (this.player) {
if (this.audioContext) {
this.player.cancelQueue(this.audioContext);
}
}
var AudioContextFunc = window.AudioContext || window.webkitAudioContext;
this.audioContext = new AudioContextFunc();
this.destination = this.audioContext.destination;
this.player = new WebAudioFontPlayer();
this.equalizer = this.player.createChannel(this.audioContext);
this.output = this.audioContext.createGain();
this.echo = this.player.createReverberator(this.audioContext);
this.echo.wet.gain.setTargetAtTime(this.state.echo, 0, 0.0001);
this.echo.output.connect(this.output);
this.equalizer.output.connect(this.echo.input);
this.output.connect(this.destination);
this.volumesInstrument = [];
this.volumesDrum = [];
this.midiNotes = [];
}
cacheInstrument(n) {
initAudio() {
console.log('initAudio M♩D♩Sounds');
if (this.player) {
if (this.audioContext) {
this.player.cancelQueue(this.audioContext);
}
}
var AudioContextFunc = window.AudioContext || window.webkitAudioContext;
this.audioContext = new AudioContextFunc();
this.target = this.audioContext.destination;
this.player = new WebAudioFontPlayer();
this.equalizer = this.player.createChannel(this.audioContext);
//this.echo = this.player.createReverberator(this.audioContext);
//this.echo.output.connect(this.target);
//this.equalizer.output.connect(this.echo.input);
this.equalizer.output.connect(this.target);
this.volumesInstrument = [];
this.volumesDrum = [];
this.midiNotes = [];
}
resetAudio() {
initAudio() {
console.log('initAudio M♩D♩Sounds');
if (this.player) {
if (this.audioContext) {
this.player.cancelQueue(this.audioContext);
}
}
var AudioContextFunc = window.AudioContext || window.webkitAudioContext;
this.audioContext = new AudioContextFunc();
this.destination = this.audioContext.destination;
this.player = new WebAudioFontPlayer();
this.equalizer = this.player.createChannel(this.audioContext);
this.output = this.audioContext.createGain();
this.echo = this.player.createReverberator(this.audioContext);
this.echo.wet.gain.setTargetAtTime(this.state.echo, 0, 0.0001);
this.echo.output.connect(this.output);
this.equalizer.output.connect(this.echo.input);
this.output.connect(this.destination);
this.volumesInstrument = [];
this.volumesDrum = [];
this.midiNotes = [];
}
cacheInstrument(n) {