CzRger 1 месяц назад
Родитель
Сommit
a54c961c59
1 измененных файлов с 1 добавлено и 2 удалено
  1. 1 2
      src/utils/useSpeechToAudio.ts

+ 1 - 2
src/utils/useSpeechToAudio.ts

@@ -21,8 +21,7 @@ export default function useSpeechToAudio({
       // 请求麦克风权限
       const stream = await navigator.mediaDevices.getUserMedia({ audio: true })
 
-      const audioContext = new (window.AudioContext ||
-        window.webkitAudioContext)()
+      const audioContext = new window.AudioContext()
       state.analyser = audioContext.createAnalyser()
       state.analyser.fftSize = 256
       const microphone = audioContext.createMediaStreamSource(stream)