
Untitled
By: a guest on
Jul 31st, 2012 | syntax:
None | size: 1.13 KB | hits: 12 | expires: Never
Batch or VBS | How to check the bitrate of a music file?
for /f "tokens=*" %%%% in ('mediainfo "%%a" "--Inform=General;%%BitRate/String%%"') do set "BitRate=%%~%%"
' create shell object
Set WshShell = CreateObject("WScript.Shell")
' Create dMC Object
Set dMC = CreateObject("dMCScripting.Converter")
'Read audio properties of a file
Dim AudioProps
AudioProps = dMC.AudioProperties("C:test.aac")
Call WshShell.Popup(AudioProps, , "Returned Audio Properties", 0)
@echo off
rundll32.exe dMCScripting.Converter.AudioProperties("C:Test.aac") > test.txt
exit
mplayer "test.aac" -frames 0 | findstr "kbit"
Set objPlayer = CreateObject("WMPlayer.OCX" )
Set colMediaCollection = objPlayer.mediaCollection
Set colMedia = colMediaCollection.getAll()
For i = 0 to colMedia.Count - 1
Set objItem = colMedia.Item(i)
Wscript.Echo objItem.Name & " : " & objItem.GetItemInfo("bitrate")
Next
require "audioinfo"
AudioInfo.open("R:/mp3/j/John Coltrane - I Think.mp3") do |info|
puts info.to_h
end
=>{"artist"=>"John Coltrane", "album"=>"John Coltrane", "title"=>"I Think", "tracknum"=>nil, "date"=>nil, "length"=>272, "bitrate"=>128}