加载使用Web音频API的3D音频系统的测试。

huangapple go评论79阅读模式
英文:

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中按照这里的说明对您的代码进行性能分析。

类似的事情也可以在Firefox中完成,如这里这里所述。

不幸的是,目前没有办法在运行时执行任何操作。但很快可能会有一个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.

huangapple
  • 本文由 发表于 2023年7月31日 19:08:35
  • 转载请务必保留本文链接:https://go.coder-hub.com/76803012.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定