In reply to Tony Naylor:
amended since i screwed up the comparison and had <= rather than <.
ok, this needs powershell installed, if you havent used it before.
For windows 7 it should be installed by default.
Various ways to run it. Easiest is to go to Accessories/powershell then the ISE. To use paste the script into the bottom part of the window.
script partly nicked from here
http://stackoverflow.com/questions/1153819/get-list-of-files-recursively-by...
You will need to alter the directory and also may need to add a few more file extensions.
this will lose the backslashes when displayed on the forum so you will need to correct both the directory and also the out-file. Doesnt look like anything else gets changed though.
the minimumbitrate is a misleading name since the original code found those larger and I just reversed it.
It will write to badmusic.txt in the c:temp folder.
function Get-Mp3Files( [string]$directory = "D:MusicMusic", [int]$minimumBitrate = 320 ) {
$shellObject = New-Object -ComObject Shell.Application
$bitrateAttribute = 0
$results = @()
# Find all mp3 files under the given directory
$mp3Files = Get-ChildItem $directory -recurse * -include *.mp3,*.m4a
foreach( $file in $mp3Files ) {
# Get a shell object to retrieve file metadata.
$directoryObject = $shellObject.NameSpace( $file.Directory.FullName )
$fileObject = $directoryObject.ParseName( $file.Name )
# Find the index of the bit rate attribute, if necessary.
for( $index = 5; -not $bitrateAttribute; ++$index ) {
$name = $directoryObject.GetDetailsOf( $directoryObject.Items, $index )
if( $name -eq 'Bit rate' ) { $bitrateAttribute = $index }
}
# Get the bit rate of the file.
$bitrateString = $directoryObject.GetDetailsOf( $fileObject, $bitrateAttribute )
if( $bitrateString -match 'd+' ) { [int]$bitrate = $matches[0] }
else { $bitrate = -1 }
# If the file has the desired bit rate, include it in the results.
if( $bitrate -lt $minimumBitrate ) {$results += $file }
}
$results | Out-File C:tempbadmusic.txt
}
Get-Mp3Files