diff --git a/src/App.js b/src/App.js
index a42499b..357790f 100644
--- a/src/App.js
+++ b/src/App.js
@@ -1,10 +1,9 @@
import "./App.css";
-import { useCallback, useEffect, useRef, useState } from "react";
+import { useEffect, useRef, useState } from "react";
import WaveForm from "./WaveForm";
const App = () => {
- const [audioUrl, setAudioUrl] = useState(),
- [analyzerData, setAnalyzerData] = useState(null),
+ const [analyzerData, setAnalyzerData] = useState(null),
[bounce, setBounce] = useState(''),
[json, setJson] = useState({}),
[currentVolume, setCurrentVolume] = useState(0.5),
@@ -80,14 +79,13 @@ const App = () => {
useEffect(() => {
loadData()
loadListeners()
- setAudioUrl('/stream.mp3')
audioAnalyzer()
const inter = setInterval(() => {
loadData()
loadListeners()
}, (Math.floor(Math.random() * 20) + 10) * 1000)
return () => clearInterval(inter)
- }, [])
+ }, [audioElmRef.current])
useEffect(() => {
if (audioElmRef.current && audioElmRef.current.volume !== currentVolume && currentVolume >= 0 && currentVolume <= 1) {
audioElmRef.current.volume = currentVolume
@@ -120,7 +118,7 @@ const App = () => {
}
-
+
>
)
}