|
|
@@ -358,7 +358,8 @@ const toggleSpeechInput = async () => {
|
|
|
mediaStream.value = stream
|
|
|
|
|
|
// 使用Web Audio API捕获音频并转换为PCM格式
|
|
|
- audioContext.value = new (window.AudioContext || window.webkitAudioContext)({ sampleRate: 16000 })
|
|
|
+ // 不指定采样率,使用默认值,确保与媒体流兼容
|
|
|
+ audioContext.value = new (window.AudioContext || window.webkitAudioContext)()
|
|
|
mediaStreamSource.value = audioContext.value.createMediaStreamSource(stream)
|
|
|
|
|
|
// 尝试使用AudioWorkletNode(现代浏览器推荐),如果不支持则回退到ScriptProcessorNode
|