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.started = false;
this.audioContext = new ctx();
try {
this.audioContext = new ctx({sampleRate: 44100});
} catch (error) {
this.audioContext = new ctx();
}
var me = this;
this.audioContext.onstatechange = function() {
if (me.audioContext.state !== 'running') return;