问题
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