So that's today's puzzle, how do we quickly find all the music albums (folders) that have low bitrates so we can re-rip them with better sampling and sound quality? The other day we were looking for music folders without CD cover art and we sorted that problem using a windows script in visual basic. So let's modify that script to find and report folders whose MP3 files have low bitrates (below 128 kbps).
(We could use xplorer² to search for low bitrates without scripts but it would be tricky to extract the folder names from the search results)
The script recursively enters folders looking for audio files, then it checks the System.Audio.EncodingBitrate property to get the bitrate. If it is below 128000 (note this number is in base units, not kbps) we store the folder name in a file called REPORT.TXT and proceed. The VBS file can be downloaded from here.
REM scan music folders and print those with low bitrate Set oFSO = CreateObject("Scripting.FileSystemObject") set oFile = oFSO.CreateTextFile("report.txt", True) Set oSHApp = WScript.CreateObject("Shell.Application") ' examine all folders starting from where we are located Set oShell = WScript.CreateObject("WScript.Shell") call listdir(oShell.CurrentDirectory) oFile.Close oShell.Run "report.txt" REM --------- Sub listDir(what) Set oDir = oFSO.GetFolder(what) ' keep the shell folder in parallel for extended properties Set oFolder = oSHApp.Namespace(what) bHasLowBit = false For Each f in oDir.Files strType = lcase(f.Type) if Instr(strType, "audio") > 0 OR Instr(strType, "sound") > 0 then set i = oFolder.ParseName(f.Name) ' avoid 800a01ca error, see http://support.microsoft.com/kb/195180/en-gb tmp = clng(i.ExtendedProperty("System.Audio.EncodingBitrate")) ' check its bitrate if its <= 128 kbps if tmp <= 128000 then bHasLowBit = true exit for end if end if Next if bHasLowBit then ' we must rip this folder again oFile.WriteLine(what) end if ' recursively enter subfolders For Each f in oDir.subfolders call listdir(what & "\" & f.name) Next end sub
The notable difference from the old versions of this script is that instead of using WSH own Scripting.FileSystemObject.Folder object we keep in parallel the "low level" Shell.Application.Folder object which allows extracting extended properties like the bitrate.
PS. Coming back to the stereo problem, it wasn't just my stinginess and drive for lower size MP3 files that caused the sound glitch. The old audio disc in question was badly encoded in the first place so it sounded rubbish on any computer CDROM drive (it was ok in normal CD players). Increasing the ripping bitrate didn't have any effect restoring the sound quality. The solution was to extract the tracks in mono instead of stereo mode.
Post a comment on this topic »