From 57efdff43ec4bf8a303e92922846a2407a4af190 Mon Sep 17 00:00:00 2001 From: dl9rdz Date: Wed, 6 Jan 2021 09:35:00 +0100 Subject: [PATCH] try enforcing 44100 samples/s for audio to avoid problems with odd defautl sampling rates --- htdocs/lib/AudioEngine.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/lib/AudioEngine.js b/htdocs/lib/AudioEngine.js index 9434c83..eb7fa4f 100644 --- a/htdocs/lib/AudioEngine.js +++ b/htdocs/lib/AudioEngine.js @@ -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;