I have a large collection of music and would like to know the bit rate and bit depth of the individual files. What is the simplest/easiest way to achieve this?
EDIT FOR ADDED DETAILS: I am using Windows 10 and it does not show properties of all the files in folders (there is no way to 'expand' a folder as on a mac when in detail view). I know how to add the bit depth label and bit rate label to a window when I open the folder to view the files in it. But I need to find all files for example that have a bit depth of 24 bits in a set of nested folders that contain many music files : some 16 bit and some 24 bit. The goal of this exercise is to segregate all files> 16 bits to another directory.
I tried using mp3 tag, an application that lists these properties for all files in a directory (even those deeply nested) but it is agonizingly slow on my laptop (30000 files would take 5 hours just to list). I tried using mediainfo (from mediaarea.net) but it only works on individual files. I tried mapping the network folder (where the files exist) and using the 'tree' command but it does not work either. A google search for 'recursively list bit rate of all files in windows' gave a few links one of which was 11 years old here. I modified it for flac like so
function Get-FLACs( [string]$directory = "$pwd", [int]$minimumBitrate = 32 ) {
$shellObject = New-Object -ComObject Shell.Application
$bitrateAttribute = 0
# Find all flac files under the given directory
$flacFiles = Get-ChildItem $directory -recurse -filter '*.flac'
foreach( $file in $flacFiles ) {
# Get a shell object to retrieve file metadata.
$directoryObject = $shellObject.NameSpace( $file.Directory.FullName )
$fileObject = $directoryObject.ParseName( $file.Name )
Write-Output ("filename",$fileObject)
# Find the index of the bit depth attribute, if necessary.
for( $index = 5; -not $bitdepthAttribute; ++$index ) {
$name = $directoryObject.GetDetailsOf( $directoryObject.Items, $index )
if( $name -eq 'Bit depth' ) {
$bitdepthAttribute = $index
Write-Output ("bit depth index",$bitdepthAttribute)
$bitdepthString = $directoryObject.GetDetailsOf( $fileObject, $bitdepthAttribute )
Write-Output ("bit depth",$bitdepthString)
}
}
}
I tried to test the above script on a folder with 2 flac files both of which are 24 bit depth and 96 khz sample rate.
The output of the script above was
Directory: C:\Users\Stefan\Downloads\Compare formats
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 6/15/2014 11:27 PM 66131611 BATIK - The Old Man FLAC.flac
174
-a---- 4/26/2014 8:41 PM 34188974 Carmen Gomes Inc - A 1000 Shades of Blue FLAC.flac
PS C:\Users\Stefan\Downloads\Compare formats> Get-FLACs
filename
Application : System.__ComObject
Parent : System.__ComObject
Name : BATIK - The Old Man FLAC
Path : C:\Users\Stefan\Downloads\Compare formats\BATIK - The Old Man FLAC.flac
GetLink :
GetFolder :
IsLink : False
IsFolder : False
IsFileSystem : True
IsBrowsable : False
ModifyDate : 6/15/2014 11:27:46 PM
Size : 66131611
Type : FLAC File
bit depth index
174
bit depth
filename
Application : System.__ComObject
Parent : System.__ComObject
Name : Carmen Gomes Inc - A 1000 Shades of Blue FLAC
Path : C:\Users\Stefan\Downloads\Compare formats\Carmen Gomes Inc - A 1000 Shades of Blue FLAC.flac
GetLink :
GetFolder :
IsLink : False
IsFolder : False
IsFileSystem : True
IsBrowsable : False
ModifyDate : 4/26/2014 8:41:08 PM
Size : 34188974
Type : FLAC File
For the first file it found the attribute 'bit-depth' and its index (174) but did not find the attribute for the second file. In neither case did the script actually find the correct bit depth but just left the value blank.