Capturing sound input with low latency in the browser

做~自己de王妃 提交于 2019-12-08 02:26:51

问题


Is it possible to capture low-latency sound input in the browser? mainly for recording a guitar. (I know it depends on the hardware too, but let's assume the hardware is good enough). I tried to use the Web Audio API, but it had somewhat bad latency. Are there any other technologies out there that gives high performance sound-input capturing in the browser? Is it possible to use Unity3D for that?

Thanks.


回答1:


"Web Audio API latency was bad" ignores a lot of potential issues. Low latency nearly always needs some tweaking.

1) Latency is considerably lower (3ms or so, commonly) on OSX than on Windows (10ms or so common). It can be VERY high on Linux, mostly due to hardware tuning issues.

2) Latency can be tuned on most systems, but you are ALWAYS going to have latency in digital audio.

3) On OSX, at least, you can also reduce the latency by increasing the sample rate - it's ~3ms at 44.1kHz, but if you record at 88.2kHz it's half that. :)

I play and record guitar through web audio on my Mac, and find it completely acceptable. YMMV.

Oh, and ScriptProcessorNodes are very bad for keeping your latency low - it is far and away best if you can eliminate them from your audio path.



来源:https://stackoverflow.com/questions/17746622/capturing-sound-input-with-low-latency-in-the-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!