VideoHelp Forum
+ Reply to Thread
Results 1 to 8 of 8
Thread
  1. Member
    Join Date
    Jun 2012
    Location
    New Zealand
    Search Comp PM
    Anyone have/know a program that will report the audio levels of a flac file?
    I know foobar offers replay gain levels but the results don't seem to be able to be exported, nor show the tracks full filename.
    Thanks for any info.
    Last edited by kirkmc; 27th Feb 2023 at 01:47.
    Quote Quote  
  2. Member
    Join Date
    Jun 2012
    Location
    New Zealand
    Search Comp PM
    Hi Pandy the 2nd link looked promising but instructions are a bit mickey mouse
    Detect the audio file volume with ffmpeg.
    Require tools
    ffmpeg: Official site, Download
    How to use
    Download ffmpeg from link
    Extract the ffmpeg.exe from zip package and copy to the directory contain the audio file
    Copy the volumeDetect.bat into the folder. (Just make sure the bat file and ffmpeg.exe are in the same directory)

    The first link doesn't offer a zip file and the second link is a 404.
    I have an ffmpeg.exe that's 35,358 KB but no volumeDetect.bat. Has anyone got that ? Thanks.
    Quote Quote  
  3. Member
    Join Date
    Jun 2012
    Location
    New Zealand
    Search Comp PM
    I did manage to open the ffmpeg .7z file but it didn't contain any volumeDetect batch file mentioned as needing.
    Quote Quote  
  4. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    Audacity will show the audio levels of a flac file but doesn't do in batch mode.
    I think,therefore i am a hamster.
    Quote Quote  
  5. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Or possibly Ocenaudio, gives peak and average RMS
    Image Attached Thumbnails Click image for larger version

Name:	stats.jpg
Views:	30
Size:	58.9 KB
ID:	69493  

    Quote Quote  
  6. You need to create batch (bat or cmd) file by yourself however i can provide some batch as example:

    Code:
    @setlocal
    
    @REM Where to Find ffmpeg
    @set FFMPG=C:\FF
    @set PATH=%FFMPG%;%PATH%
    
    @set fname=%~1
    
    @ffmpeg.exe -vn -sn -dn -y -hide_banner -v 32 -i "%fname%" -filter:a volumedetect,astats -f null - >NUL  2> "%~n1_vol_stat.txt"
    
    @endlocal
    @pause
    result of ffmpeg will be file with name your 'audiofile_vol_stat.txt' and you can see example of action for above filter bellow:

    Code:
    Guessed Channel Layout for Input Stream #0.0 : stereo
    Input #0, wav, from '997Hz_48k.wav':
      Duration: 00:00:01.00, bitrate: 1536 kb/s
        Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16, 1536 kb/s
    Stream mapping:
      Stream #0:0 -> #0:0 (pcm_s16le (native) -> pcm_s16le (native))
    Press [q] to stop, [?] for help
    Output #0, null, to 'pipe:':
      Metadata:
        encoder         : Lavf58.39.101
        Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
        Metadata:
          encoder         : Lavc58.73.102 pcm_s16le
    size=N/A time=00:00:01.00 bitrate=N/A speed=N/A    
    video:0kB audio:188kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
    [Parsed_volumedetect_0 @ 0000000002a19880] n_samples: 96000
    [Parsed_volumedetect_0 @ 0000000002a19880] mean_volume: -6.0 dB
    [Parsed_volumedetect_0 @ 0000000002a19880] max_volume: -3.0 dB
    [Parsed_volumedetect_0 @ 0000000002a19880] histogram_3db: 28622
    [Parsed_astats_1 @ 0000000002a19c80] Channel: 1
    [Parsed_astats_1 @ 0000000002a19c80] DC offset: -0.000000
    [Parsed_astats_1 @ 0000000002a19c80] Min level: -23186.000000
    [Parsed_astats_1 @ 0000000002a19c80] Max level: 23184.000000
    [Parsed_astats_1 @ 0000000002a19c80] Min difference: 0.000000
    [Parsed_astats_1 @ 0000000002a19c80] Max difference: 3067.000000
    [Parsed_astats_1 @ 0000000002a19c80] Mean difference: 1923.715244
    [Parsed_astats_1 @ 0000000002a19c80] RMS difference: 2136.716944
    [Parsed_astats_1 @ 0000000002a19c80] Peak level dB: -3.004217
    [Parsed_astats_1 @ 0000000002a19c80] RMS level dB: -6.020334
    [Parsed_astats_1 @ 0000000002a19c80] RMS peak dB: -6.013386
    [Parsed_astats_1 @ 0000000002a19c80] RMS trough dB: -6.056426
    [Parsed_astats_1 @ 0000000002a19c80] Crest factor: 1.415161
    [Parsed_astats_1 @ 0000000002a19c80] Flat factor: 0.000000
    [Parsed_astats_1 @ 0000000002a19c80] Peak count: 2
    [Parsed_astats_1 @ 0000000002a19c80] Bit depth: 16/16
    [Parsed_astats_1 @ 0000000002a19c80] Dynamic range: 87.304517
    [Parsed_astats_1 @ 0000000002a19c80] Zero crossings: 1994
    [Parsed_astats_1 @ 0000000002a19c80] Zero crossings rate: 0.041542
    [Parsed_astats_1 @ 0000000002a19c80] Channel: 2
    [Parsed_astats_1 @ 0000000002a19c80] DC offset: -0.000000
    [Parsed_astats_1 @ 0000000002a19c80] Min level: -23186.000000
    [Parsed_astats_1 @ 0000000002a19c80] Max level: 23187.000000
    [Parsed_astats_1 @ 0000000002a19c80] Min difference: 0.000000
    [Parsed_astats_1 @ 0000000002a19c80] Max difference: 3053.000000
    [Parsed_astats_1 @ 0000000002a19c80] Mean difference: 1923.707286
    [Parsed_astats_1 @ 0000000002a19c80] RMS difference: 2136.716597
    [Parsed_astats_1 @ 0000000002a19c80] Peak level dB: -3.003842
    [Parsed_astats_1 @ 0000000002a19c80] RMS level dB: -6.020335
    [Parsed_astats_1 @ 0000000002a19c80] RMS peak dB: -6.013388
    [Parsed_astats_1 @ 0000000002a19c80] RMS trough dB: -6.056426
    [Parsed_astats_1 @ 0000000002a19c80] Crest factor: 1.415222
    [Parsed_astats_1 @ 0000000002a19c80] Flat factor: 0.000000
    [Parsed_astats_1 @ 0000000002a19c80] Peak count: 2
    [Parsed_astats_1 @ 0000000002a19c80] Bit depth: 16/16
    [Parsed_astats_1 @ 0000000002a19c80] Dynamic range: 93.325491
    [Parsed_astats_1 @ 0000000002a19c80] Zero crossings: 1994
    [Parsed_astats_1 @ 0000000002a19c80] Zero crossings rate: 0.041542
    [Parsed_astats_1 @ 0000000002a19c80] Overall
    [Parsed_astats_1 @ 0000000002a19c80] DC offset: -0.000000
    [Parsed_astats_1 @ 0000000002a19c80] Min level: -23186.000000
    [Parsed_astats_1 @ 0000000002a19c80] Max level: 23187.000000
    [Parsed_astats_1 @ 0000000002a19c80] Min difference: 0.000000
    [Parsed_astats_1 @ 0000000002a19c80] Max difference: 3067.000000
    [Parsed_astats_1 @ 0000000002a19c80] Mean difference: 1923.711265
    [Parsed_astats_1 @ 0000000002a19c80] RMS difference: 2136.716771
    [Parsed_astats_1 @ 0000000002a19c80] Peak level dB: -3.003842
    [Parsed_astats_1 @ 0000000002a19c80] RMS level dB: -6.020335
    [Parsed_astats_1 @ 0000000002a19c80] RMS peak dB: -6.013386
    [Parsed_astats_1 @ 0000000002a19c80] RMS trough dB: -6.056426
    [Parsed_astats_1 @ 0000000002a19c80] Flat factor: 0.000000
    [Parsed_astats_1 @ 0000000002a19c80] Peak count: 2.000000
    [Parsed_astats_1 @ 0000000002a19c80] Bit depth: 16/16
    [Parsed_astats_1 @ 0000000002a19c80] Number of samples: 48000


    IMPORTANT:
    I assumed that your ffmpeg.exe will be located on disk C in folder 'FF' - you can easily change this assumption by editing one of the batch lines - this one:

    Code:
    @REM Where to Find ffmpeg
    @set FFMPG=C:\FF
    modify
    Code:
    @set FFMPG=C:\FF
    to real folder where ffmpeg.exe is located line beginning with REM is commentary line to emphasize below line with ffmpeg.exe location i.e. if your ffmpeg.exe is located on disk D in folder named 'myffmpeg' then line:

    Code:
    @REM Where to Find ffmpeg
    @set FFMPG=C:\FF
    shall be replaced with line:
    Code:
    @REM Where to Find ffmpeg
    @set FFMPG=D:\myffmpeg
    how to create batch file?

    Simplest way:

    - run notepad
    - copy and paste (CTRL+C, CTRL+V) above example to your notepad, save edited text as 'nameyoulike.bat' or 'nameyoulike.cmd'

    now you can test audio level in your file with drag & drop in Windows as your batch file is considered to be application

    beware, i see that drag & drop seem to be inactive in win10/11 - if this is your case consider to use batch from command line i.e. open cmd and write 'nameyoulike.bat' or 'nameyoulike.cmd' and after 1 space place filename you wish to examine (to reduce effort write few first letters and press TAB key so commandline should complete rest) alternatively activate drag & drop.
    Personally i recommends some file commander such as splendid Total Commander so working with files is way more efficient than ineffective Windows (yes i'm old, i grow with xtree, norton commander and their heritage)
    Last edited by pandy; 28th Feb 2023 at 11:56.
    Quote Quote  
  7. Originally Posted by kirkmc View Post
    Anyone have/know a program that will report the audio levels of a flac file?
    I know foobar offers replay gain levels but the results don't seem to be able to be exported, nor show the tracks full filename.
    Thanks for any info.
    A bit of a late reply, but for the record, you'd need the foobar2000 text tools component. After you've added it to fb2k find it's page in preferences.

    Edited to improve the text.

    Default Header field
    Code:
    // evaluated for the first track
    Selected Tracks:$crlf()$crlf()
    Some additions to the Body field (copied and pasted from my Playlist columns)
    Code:
    // evaluated for every track
    $swapprefix(%filename_ext%)$crlf()
    $ifequal($meta_num(title),0,No Title,$swapprefix(%title%))$crlf()
    $if(%replaygain_track_gain%,Track Gain  %replaygain_track_gain%  |  
    Volume  $puts(T_VOL,$sub(-1800,$replace(%replaygain_track_gain%,.,)))$puts(T_VOLUME,$ifgreater($get(T_VOL),9999,+$substr($get(T_VOL),1,3).$substr($get(T_VOL),4,5),$ifgreater($get(T_VOL),-10000,$ifequal($get(T_VOL),0,0,$ifgreater($get(T_VOL),0,$replace(+$substr($num($get(T_VOL),4),1,2),+0,+),$replace($substr($num($get(T_VOL),5),1,3),-0,-))).$substr($num($get(T_VOL),5),4,5),$substr($get(T_VOL),1,4).$substr($get(T_VOL),5,6))) LUFS  |  )$get(T_VOLUME),No Track Gain  |  )
    $if(%replaygain_track_peak_db%,Peak  $puts(PEAK,$ifequal(0,$replace(%replaygain_track_peak_db%,.,),0.00 dB,%replaygain_track_peak_db%))$get(PEAK)$crlf(),No Track Peak$crlf())$crlf()
    Default Footer field
    Code:
    // evaluated for the last track
    '('%list_total% Total')'$crlf()
    Select the files in the playlist you want the volume information for. Right click and under Legacy Commands (or maybe somewhere different for newer versions) select "copy text". Here's an example of what's copied to the Windows clipboard.

    Code:
    Selected Tracks:
    
    A random file.mkv
    No Title
    No Track Gain  |  No Track Peak
    
    Joe Cocker - 01 - Unchain My Heart (90's Version).mp3
    Unchain My Heart (90's Version)
    Track Gain  +0.09 dB  |  Volume  -18.09 LUFS  |  Peak  -4.41 dB
    
    Joe Cocker - 03 - When The Night Comes.mp3
    When The Night Comes
    Track Gain  -0.39 dB  |  Volume  -17.61 LUFS  |  Peak  -3.05 dB
    
    Joe Cocker - 05 - Now That The Magic Has Gone.mp3
    Now That The Magic Has Gone
    Track Gain  -0.50 dB  |  Volume  -17.50 LUFS  |  Peak  -3.49 dB
    
    Joe Cocker - 06 - Don't You Love Me Anymore.mp3
    Don't You Love Me Anymore
    Track Gain  -0.16 dB  |  Volume  -17.84 LUFS  |  Peak  -4.33 dB
    
    Joe Cocker - 07 - I Can Hear The River.mp3
    I Can Hear The River
    Track Gain  +0.14 dB  |  Volume  -18.14 LUFS  |  Peak  -4.29 dB
    
    Joe Cocker - 08 - Sorry Seems To Be The Hardest Word.mp3
    Sorry Seems To Be The Hardest Word
    Track Gain  +0.11 dB  |  Volume  -18.11 LUFS  |  Peak  -2.84 dB
    
    Joe Cocker - 09 - Shelter Me.mp3
    Shelter Me
    Track Gain  +0.58 dB  |  Volume  -18.58 LUFS  |  Peak  -5.13 dB
    
    Joe Cocker - 10 - Feels Like Forever.mp3
    Feels Like Forever
    Track Gain  +0.29 dB  |  Volume  -18.29 LUFS  |  Peak  -5.04 dB
    
    Joe Cocker - 13 - Now That You're Gone.mp3
    Now That You're Gone
    Track Gain  +0.12 dB  |  Volume  -18.12 LUFS  |  Peak  -4.79 dB
    
    Joe Cocker - 15 - When A Woman Cries.mp3
    When A Woman Cries
    Track Gain  -0.49 dB  |  Volume  -17.51 LUFS  |  Peak  -2.86 dB
    
    (11 Total)
    Last edited by hello_hello; 6th Mar 2023 at 10:05.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!