|
@@ -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)
|