From 8130a665e9564d146246900cfc6f2785a6069536 Mon Sep 17 00:00:00 2001 From: WofWca Date: Tue, 13 Apr 2021 17:49:41 +0800 Subject: [PATCH] perf: use `latencyHint: 'playback' for AudioContext --- src/content/audioContext.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/content/audioContext.ts b/src/content/audioContext.ts index 1464e024..4ac9a42e 100644 --- a/src/content/audioContext.ts +++ b/src/content/audioContext.ts @@ -1,4 +1,6 @@ -export const audioContext = new AudioContext(); +export const audioContext = new AudioContext({ + latencyHint: 'playback', +}); // Doing it the way it's suggested in https://stackoverflow.com/a/39725071/10406353 export const mediaElementSourcesMap: WeakMap = new WeakMap();