Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 31st, 2012  |  syntax: None  |  size: 1.13 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Batch or VBS | How to check the bitrate of a music file?
  2. for /f "tokens=*" %%%% in ('mediainfo "%%a" "--Inform=General;%%BitRate/String%%"') do set "BitRate=%%~%%"
  3.        
  4. ' create shell object
  5. Set WshShell = CreateObject("WScript.Shell")
  6.  
  7. ' Create dMC Object
  8. Set dMC = CreateObject("dMCScripting.Converter")
  9.  
  10. 'Read audio properties of a file
  11. Dim AudioProps
  12. AudioProps = dMC.AudioProperties("C:test.aac")
  13. Call WshShell.Popup(AudioProps, , "Returned Audio Properties", 0)
  14.        
  15. @echo off
  16. rundll32.exe dMCScripting.Converter.AudioProperties("C:Test.aac") > test.txt
  17. exit
  18.        
  19. mplayer "test.aac" -frames 0 | findstr "kbit"
  20.        
  21. Set objPlayer = CreateObject("WMPlayer.OCX" )
  22. Set colMediaCollection = objPlayer.mediaCollection
  23.  
  24. Set colMedia = colMediaCollection.getAll()
  25.  
  26. For i = 0 to colMedia.Count - 1
  27.     Set objItem = colMedia.Item(i)
  28.     Wscript.Echo objItem.Name & " : " & objItem.GetItemInfo("bitrate")
  29. Next
  30.        
  31. require "audioinfo"
  32.  
  33. AudioInfo.open("R:/mp3/j/John Coltrane - I Think.mp3") do |info|
  34.   puts info.to_h
  35. end
  36. =>{"artist"=>"John Coltrane", "album"=>"John Coltrane", "title"=>"I Think", "tracknum"=>nil, "date"=>nil, "length"=>272, "bitrate"=>128}