我用web audio API播放了一个声音,并用gainNode改变了音量。当我更改了gainNode的值时,分贝计显示了一个意外的数字。
context.createGain();
var source=context.createOscillator();
source.frequency.value=1000;
source.start();
source.connect(gainNode);
gainNode.connect(context.destination);
gainNode.gain.value=Math.pow(10, dbfs/20));
when dbfs=0,the Decibel meter showed 90 dbspl;
when dbfs=-10,the Decibel meter showed 84 dbspl;
when dbfs=-20,the Decibel meter showed 78 dbspl;
when dbfs=-30,the Decibel meter showed 72 dbspl;
when dbfs=-40,the Decibel meter showed 62 dbspl;
when dbfs=-50,the Decibel meter showed 52 dbspl;实际的音量没有像预期的那样变化,是否在生成gainNode的值时有什么错误?我想在80分贝的spl或其他特定数字下播放声音,dbfs的值是多少,如何使gainNode的值?
发布于 2016-08-19 12:42:54
你的方法的一个缺点是你使用的是正弦波音调。你需要使用粉色噪声,否则你房间里的反射可能会显著改变声波的能量。
理想情况下,您应该在电波暗室或自由场中进行测量,以避免反射的干扰。
另一个问题可能是由于SPL计量器的不准确或扬声器系统的非线性。比方说,你的SPL计量器校准了吗?
我强烈推荐阅读this article中关于SPL测量的内容。
一般来说,数字和电学领域(即您的计算机、DAC和放大器内部)中的音频比声学领域(即您的房间、扬声器和麦克风)中的音频更线性、更无失真,因此我将首先查找它们的问题,而不是软件问题。您可以尝试使用REW 作为参考,也可以先将其作为测试声音/麦克风系统的工具。
https://stackoverflow.com/questions/39023244
复制相似问题