在浏览器中以低延迟捕获声音输入 [英] Capturing sound input with low latency in the browser

查看:138
本文介绍了在浏览器中以低延迟捕获声音输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在浏览器中捕获低延迟声音输入?主要用于录制吉他。 (我知道这也取决于硬件,但我们假设硬件足够好)。
我试图使用Web Audio API,但它的延迟有些不好。是否有其他技术可以在浏览器中提供高性能的声音输入捕获?是否有可能使用Unity3D?

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?

谢谢。

推荐答案

Web Audio API延迟很糟糕忽略了许多潜在问题。低延迟几乎总是需要一些调整。

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

1)OSX上的延迟相当低(通常为3ms左右),而不是Windows(10ms左右常见)。它在Linux上可能非常高,主要是由于硬件调优问题。

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)大多数系统都可以调整延迟,但是你总是会遇到数字延迟音频。

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

3)至少在OSX上,您还可以通过提高采样率来减少延迟 - 在44.1kHz时为~3ms,但如果您在88.2录制这是它的一半。 :)

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. :)

我在Mac上通过网络音频播放和录制吉他,并发现它完全可以接受。 YMMV。

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

哦,ScriptProcessorNodes对于保持低延迟非常糟糕 - 如果你可以从你的音频路径中删除它们,那就太好了。

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.

这篇关于在浏览器中以低延迟捕获声音输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆