Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor() {
try {
this.context = window.webkitAudioContext
? new sAudioContext()
: new AudioContext()
document.body.addEventListener('mousedown', this.resumeAudio)
document.body.addEventListener('keydown', this.resumeAudio)
}
catch (e) {
alert('Web Audio API is not supported in this browser');
return;
};
this.store = new Store(settings);
// creating controls
this.controls = [];
constructor() {
this.context = new AudioContext({
latencyHint: 'interactive'
});
this.masterGain = new GainNode(this.context);
this.masterGain.connect(this.context.destination);
this.masterSub$.next(1);
}
export function createAudioContext(): AudioContext {
return new stdAudioContext() as unknown as AudioContext;
}
export function audioContextFactory (latencyHint: IAudioContextOptions['latencyHint']): IAudioContext {
return new AudioContext({ latencyHint });
}