Body: <p>I have a process sampling <code>mean_volume</code> levels from <code>$ ffmpeg -af 'volumedetect' ...</code> <a href="https://ffmpeg.org/ffmpeg-filters.html#volumedetect" rel="nofollow noreferrer">which outputs</a> negative <code>-##.## dB</code> 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:</p>
  
  <ul>
  <li>30 dB = Leaves rustling, soft music, whisper</li>
  <li>40 dB = Average home noise</li>
  <li>60 dB = Normal conversation, background music</li>
  <li>70 dB = Office noise, inside car at 60 mph</li>
  <li>75 dB = Vacuum cleaner, average radio</li>
  </ul>
  
  <p>How should one go about converting the negative dB measurements from <code>ffmpeg</code> to positive dB values on such scales?</p>
  
  <p>(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 <a href="https://myhealth.alberta.ca/Health/Pages/conditions.aspx?hwid=tf4173#targetText=Normal%20conversation%20is%20about%2060,such%20as%20earplugs%20or%20earmuffs." rel="nofollow noreferrer">the sample above from</a>, 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 <code>ffmpeg</code> 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 <code>ffmpeg</code> output onto to these common scales.)</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-13T11:53:56.497Z
Comments.Text: Try the replaygain filter. See https://sound.stackexchange.com/a/44522
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-13T19:43:56.450Z
Comments.Text: @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 https://sound.stackexchange.com?
Comments.UserDisplayName: Ross Patterson
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-14T04:37:05.363Z
Comments.Text: The filter output prints out the gain required to achieve 89 dB. So `89 - gain_value` is the measured loudness.
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-30T17:54:32.337Z
Comments.Text: Thanks, @Gyan!  That seems to be working well.
Comments.UserDisplayName: Ross Patterson
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-30T17:55:11.143Z
Comments.Text: Oh, if you want to write that up as an answer, I'll call this answered, @Gyan.
Comments.UserDisplayName: Ross Patterson
Tags: <ffmpeg><audio><loudness>
Title: Convert ffmpeg audio volumedetect negative dB levels to common loudness positive dB levls
UserDisplayName: Ross Patterson
ThreadText: # Convert ffmpeg audio volumedetect negative dB levels to common loudness positive dB levls
  
  (Asked by: username_0 on 2019-07-13)
  
  I have a process sampling `mean_volume` levels from `$ ffmpeg -af 'volumedetect' ...` [which outputs](https://ffmpeg.org/ffmpeg-filters.html#volumedetect) 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](https://myhealth.alberta.ca/Health/Pages/conditions.aspx?hwid=tf4173#targetText=Normal%20conversation%20is%20about%2060,such%20as%20earplugs%20or%20earmuffs.), 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.)
  
  **Tags:** ffmpeg, audio, loudness
  
  > **Comments:**
  > **username_1**: Try the replaygain filter. See https://sound.stackexchange.com/a/44522  
  > **username_0**: @username_1 *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 https://sound.stackexchange.com?  
  > **username_1**: The filter output prints out the gain required to achieve 89 dB. So `89 - gain_value` is the measured loudness.  
  > **username_0**: Thanks, @username_1!  That seems to be working well.  
  > **username_0**: Oh, if you want to write that up as an answer, I'll call this answered, @username_1.  
  
  ---
  
  ## 0 answers
  
  