Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

录制的音频无法点击播放 #3

Open
liyucang-git opened this issue May 23, 2019 · 6 comments
Open

录制的音频无法点击播放 #3

liyucang-git opened this issue May 23, 2019 · 6 comments

Comments

@liyucang-git
Copy link

image
完全按照demo运行,期间并无报错,只有控制台上面图片上的信息

@devin87
Copy link
Owner

devin87 commented May 23, 2019

经测试 Chrome 74录制失效,Chrome 69和Firefox正常。代码调整了下,现在会优先使用MediaRecorder录音以支持Chrome 74,但不支持转码为mp3文件,重新下载代码运行即可。

@liyucang-git
Copy link
Author

ok

@DualWield
Copy link

如果通过mediaRecorder录制音频,怎么通过lamejs转成mp3格式的?

@devin87
Copy link
Owner

devin87 commented Jul 9, 2019

@DualWield 通过MediaRecorder录制的音频已经是压缩过的,不支持通过lamejs转成mp3格式

@xiangyuecn
Copy link

@devin87 老哥也是爱折腾😁 MediaRecorder太复杂了也对mp3录音没有什么帮助。

导致楼主这个问题是在于AudioContext初始化的时机,如果是用户刚打开页面还没有进行任何操作就创建了AudioContext对象,这个对象默认是state=suspended,需要在用户有操作后再resume()一下就能正常录音了,比如开始录音时,suspended状态下不resume就无法正常录音。

增加MediaRecorder的代码增加了复杂性,还是建议还原一下代码😂

@devin87
Copy link
Owner

devin87 commented Sep 27, 2019

@xiangyuecn 已更改为默认使用AudioContext方式录音,感谢提供解决思路。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants