Skip to content

Commit

Permalink
perf: use `latencyHint: 'playback' for AudioContext
Browse files Browse the repository at this point in the history
  • Loading branch information
WofWca committed Apr 13, 2021
1 parent 08e7c5d commit 8130a66
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/content/audioContext.ts
Original file line number Diff line number Diff line change
@@ -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<HTMLMediaElement, MediaElementAudioSourceNode> = new WeakMap();

0 comments on commit 8130a66

Please sign in to comment.