fix audio not working during development due to react's useEffect wil be triggered twice (#6126)
This commit is contained in:
parent
6a9d202414
commit
75445a0c66
1 changed files with 4 additions and 0 deletions
|
|
@ -152,6 +152,10 @@ const VoiceInput = ({
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
initCanvas()
|
initCanvas()
|
||||||
handleStartRecord()
|
handleStartRecord()
|
||||||
|
const recorderRef = recorder?.current
|
||||||
|
return () => {
|
||||||
|
recorderRef?.stop()
|
||||||
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const minutes = parseInt(`${parseInt(`${originDuration}`) / 60}`)
|
const minutes = parseInt(`${parseInt(`${originDuration}`) / 60}`)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue