英文:
load test of a 3D audio system with the web audio api
问题
你好,我有一个自己实现的网络会议室,配备了一个3D音频系统。我正在测试有多少用户可以加入这个网络会议室并使用3D音频系统。
对于每个新用户,音频流会被实例化为一个新的音频源和一个定位节点。这意味着如果在网络会议室中有20个用户,那么就会有20个音频源和20个定位节点连接到一个音频上下文中。
当我达到13个用户时,它开始发出嗡嗡声。我不确定是不是CPU的问题,因为CPU利用率达到了92%。我认为可能是其他原因,但我不知道是什么。是框架本身的问题吗?
顺便说一下,如果我使用一台性能更强的计算机,那么在音频系统开始发出嗡嗡声之前,可以连接超过13个用户。
英文:
Hello I have a self implemented web conference room with a 3D audio system. I am testing how many users can join this web conference room and use the 3D audio system,
To each new user the audio stream is instantiated as a new audio source and a panner node. That means if there are 20 users in the web conference room, then there are 20 audio sources and 20 panner nodes connected to one audiocontext.
When I get to 13 users, then it starts to buzz. I'm not sure if it's the CPU, since the CPU is at 92% utilization. I think it could be something else, but I don't know what. Is it the framework itself ?
by the way, if I use a more powerful computer, then more then 13 users can connect before the audio system starts to buzz.
答案1
得分: 1
有一个由Google的Web Audio团队开发的Chrome扩展叫做Audion。它允许您可视化音频图形。也许这已经有助于显示未使用的节点或其他看起来可疑的内容。
如果这没有帮助您,您还可以尝试在Chrome中按照这里的说明对您的代码进行性能分析。
不幸的是,目前没有办法在运行时执行任何操作。但很快可能会有一个API来访问当前的渲染能力。例如,如果浏览器处理当前的工作负载存在问题,您可以使用这个API来将panningModel
从'HRTF'
更改为'equalpower'
。
英文:
There is a Chrome extension developed by the Web Audio team at Google called Audion. It allows you to visualize the audio graph. Maybe that already helps to reveal unused nodes or anything else that looks suspicious.
If that doesn't help you could also try to profile your code in Chrome as described here.
Similar things can also be done in Firefox as described here and here.
Unfortunately there is currently no way to do any of this at runtime. But there might be an API soon to access the current render capacity. You could for example use this to change the panningModel
from 'HRTF'
to 'equalpower'
if the browser struggles with the current workload.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论