Skip to content

Commit

Permalink
fix: safari audio ctx
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardocasares committed Oct 31, 2020
1 parent f8e286b commit ea7023f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/hooks/useFrequency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ export function useFrequency() {
const [state, setState] = useState(100);

useEffect(() => {
const ctx = new AudioContext();
// @ts-ignore
const AudioCtx = window.AudioContext || window.webkitAudioContext;
const ctx = new AudioCtx();
const analyser = ctx.createAnalyser();
const source = ctx.createMediaElementSource(audio.current);
analyser.fftSize = 64;
Expand Down

1 comment on commit ea7023f

@vercel
Copy link

@vercel vercel bot commented on ea7023f Oct 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.