在一个形式的音频输出电平,可转化为分贝电平、分贝、转化为、音频输出

2023-09-05 08:51:19 作者:想炸学校好多年了

我需要找到一种方式来获得当前的音频输出的音量,而手机正在对耳机的噪音,该值将被转换为分贝。 Android的API似乎没有任何办法访问一个恒定的音量电平以外的看似随意的音量设置的水平,但我不明白的方式将其转换成一个标准的分贝级或响度的测量。我已经看到了一些方法来使用麦克风对于这一点,但不会有耳机很好地工作。

I need to find a way to get the current audio output volume while the phone is making noise on the headphones, this value will be converted to a decibel level. The android API does not appear to have any way of accessing a constant volume level other than a seemingly arbitrary volume setting level, but I dont see a way to convert that to a standard decibel level or "loudness" measurement. I have seen some ways to use the mic for this, but that wont work with headsets very well.

有谁知道一种方法来衡量任何可能的最大分贝(或标准)的输出电平进行比较的,或可能的电压被发送到耳机?

Does anyone know a way to measure either the maximum possible decibel (or some standard) output level to compare against, or possible the voltage being sent to the headset?

帮助是值得欢迎的。

推荐答案

请注意,有很多不同的含义单词分贝的。它是重presenting一些数量(如强度/功率/响度)相对于一个参考点的装置。对于内部设备的音频信号,或者在音频应用中,有0分贝的峰值水平。当声音从扬声器发出的感知响度进行测量为声音pressure等级,通常被描述为分贝(SPL)(或加权变体,如DBA)。当你看到的值,如摇滚音乐会和100dB的表那么这是所描述的SPL。这种测量是本身相对于参考电平。

Be aware that there are many different meanings of the word 'deciBel'. It is a means of representing some quantity (such as intensity/power/loudness) relative to a reference point. For audio signals inside equipment, or in an audio application, there is a peak level of 0dB. When sound is emitted from a speaker, the perceived loudness is measured as a Sound Pressure Level, often described as 'dB (SPL)' (or weighted variants such as dBA). When you see the tables of values such as rock concerts at 100dB then this is the SPL that is being described. This measurement is itself relative to a reference level.

那么,什么将有API中的音频数据,从中可以很容易地获得音频电平在原始信号(其中有一个最大的0dB)方面的缓冲。但是,您不能很容易地将其转换为一个物理的响度,因为这将是依赖于硬件。这将是一个电话模型和下一个之间的不同,并且将取决于耳机太。这样做的唯一方法是通过与SPL计测量校准手机,但随后这会给你一个结果,将所有该手机上给出合理的结果。

So what will have available in the API is the buffer of audio data from which you can easily obtain the audio level in terms of the raw signal (which has a maximum of 0dB). You can't however easily convert this to a physical loudness because this will be dependent on the hardware. It will be different between one model of phone and the next, and will depend on the headphones too. The only way of doing this will be to calibrate the phone by measuring with an SPL meter, but then this will give you a result which will only give reasonable results on this particular phone.