-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The values returned by the App #1
Comments
Hi @UdayKandpal! As I understand that -160db notation is originally for sensitivity of the whole audio system at the moment, not for actual sound level, so there are definitely things like microphone autoadjustment playing role, hence those possible sensitivity issues. Check that you disable this stuff everywhere. Conversion from [-160;0] to [0;160] can be done by simply adding 160, I think this is correct. Stretching the range to 200dB feels wrong, because that scale is logarithmic.
|
Hi @punarinta As I analysed your code, I found that rawValue will be same as value on MacOs. However, I think adding 160 might not work as value given by MacOS without any noise near microphone is -50 (that would be 110dB if we convert by adding 160), whereas it turns towards 0 or 5 (that is around 160-165 decibel which is wrong value) when song is played near MIC through earphone. On Android you have used 20 log(amplitude/32767) as formula for decibel. However we only get negative values as amplitude will be always smaller than equal to 32767 i.e. will only reach 0 on android at max. This does not give us the value required in the decibel. Could you guide us through getting the actual decibel value. |
@UdayKandpal values can sometimes get over zero because some OS's allow extra amplification. See for example a screenshot of how mic level management looks like in my Ubuntu: Or a similar thing in the settings The level you get in the library is a product of your input level and your amplification level. Unfortunately I don't know how operating systems produce the final result, but I believe if you fix the amplification on let's say 100% (0dB) level then it should work in a similar way everywhere. |
Regarding the current value on android, I think there is a typo: Math.log is used instead of Math.log10. After the change, the values (and their variations) are more comparable to those retrieved in the same conditions on iOS (the comparison is tricky due to calibration or hardware differences but at least the range is comparable). For example a quiet environment is around -45 (pseudo dBFS?). What transformations do you apply to have more comparable values or use different units? |
any update on this @ncstc1 ? |
I only made the patch I mentioned above (use log10 instead of log in RNSoundLevelModule.java). Did you make more changes on your side? |
Hi, I want to try this app for finding the decibel value of the the sound/pressure at the MIC. Your app description says -160 is the silence level. So, how to convert the values from 0 to 200 dB. Can we place a 20 dB sound near MIC and expect a value of 20 in the value or the rawValue. Basically I want to understand what value is returned in the value and rawValue of your app. On Ubuntu placing MIC near sound takes the value to at most 0 and rawValue to at most 32767. On MAC OS, the value and rawValue remain the same and got to about 6 (positive value) at most. So I wonder it can show data in decibels say for sounds of 50 dB or 90 dB. Do respond at the earliest.
The text was updated successfully, but these errors were encountered: