try enforcing 44100 samples/s for audio to avoid problems with odd defautl sampling rates

This commit is contained in:
dl9rdz 2021-01-06 09:35:00 +01:00 committed by Jakob Ketterl
parent c5323f8d54
commit 57efdff43e

View File

@ -14,7 +14,11 @@ function AudioEngine(maxBufferLength, audioReporter) {
this.onStartCallbacks = []; this.onStartCallbacks = [];
this.started = false; this.started = false;
try {
this.audioContext = new ctx({sampleRate: 44100});
} catch (error) {
this.audioContext = new ctx(); this.audioContext = new ctx();
}
var me = this; var me = this;
this.audioContext.onstatechange = function() { this.audioContext.onstatechange = function() {
if (me.audioContext.state !== 'running') return; if (me.audioContext.state !== 'running') return;