xiangyuecn / Recorder

html5 js 录音 mp3 wav ogg webm amr g711a g711u 格式,支持pc和Android、iOS部分浏览器、Hybrid App(提供Android iOS App源码)、微信,提供ASR语音识别转文字 H5版语音通话聊天示例 DTMF编码解码
https://xiangyuecn.github.io/Recorder/
MIT License
4.8k stars 1.03k forks source link

调用Recorder.GetContext(true)得到的不是running状态的AudioContext, 而是suspended #210

Closed hangxingfu closed 7 months ago

hangxingfu commented 7 months ago

想请教一下,ios移动端的录音,上传后端后无法解析,安卓的没事 ios浏览器控制台会有这样的提示 IMG_D109945C0E9F-1 ,我在文档里看可以在构造函数里面配置 runningContext , 但是用Recorder.GetContext(true)方法得不到running状态的参数。

xiangyuecn commented 7 months ago

rec.open rec.start 任意一个在用户点击操作时进行调用就可以了 Recorder.GetContext(true) 也是一样,需要在用户操作时进行调用

不然iOS上不管之前有没有用户操作,都是suspended,iOS的AudioContext不遵守自动播放策略