I have a process sampling mean_volume levels from $ ffmpeg -af 'volumedetect' ... which outputs negative -##.## dB measurements where 0 dB is very loud and -100 dB is very quiet. I need to line those measurements up with "common" loudness scales lining up different positive dB levels with noise environments we encounter such as:

  • 30 dB = Leaves rustling, soft music, whisper
  • 40 dB = Average home noise
  • 60 dB = Normal conversation, background music
  • 70 dB = Office noise, inside car at 60 mph
  • 75 dB = Vacuum cleaner, average radio

How should one go about converting the negative dB measurements from ffmpeg to positive dB values on such scales?

(There are many sources for the "common" loudness scales I refer to here, including built into various smartphone apps for measuring environmental noise and on various web pages such as where I copied the sample above from, and they all roughly agree. I would assume this conversion would require me to do some sort of "calibration" to get measurements from both the ffmpeg output and something on these common scales. That's something I can do using said apps. Perfect accuracy isn't the goal and isn't required here, just a reasonable rough mapping from the ffmpeg output onto to these common scales.)

  • Try the replaygain filter. See sound.stackexchange.com/a/44522 – Gyan Jul 13 '19 at 11:53
  • @Gyan How would I use the replaygain filter to do the conversion I'm trying to do? At any rate, that certainly seems like that's the stackexchange where this question belongs. I didn't find that one when I was trying to find the best one, I assume because it's beta. But thanks for the pointer! Can someone move this question to sound.stackexchange.com? – Ross Patterson Jul 13 '19 at 19:43
  • 1
    The filter output prints out the gain required to achieve 89 dB. So 89 - gain_value is the measured loudness. – Gyan Jul 14 '19 at 4:37
  • Thanks, @Gyan! That seems to be working well. – Ross Patterson Jul 30 '19 at 17:54
  • Oh, if you want to write that up as an answer, I'll call this answered, @Gyan. – Ross Patterson Jul 30 '19 at 17:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.