1

I would need your help with ExifTool. I am trying to check if all of my .wav files have the same amount of channels through meta-data. How should I proceed? Should I print out the tags first and then write a script to check if they are all the same or is there a better way? Thank you for your help.

ambersv
  • 33
  • 4
  • 1
    You want to check "same metadata", or just check "same number of channels"? – L. Scott Johnson Jul 02 '19 at 15:29
  • Same number of channels, updated the title – ambersv Jul 02 '19 at 15:46
  • 1
    If you want to compare against a specific number of channels, you can use the [`-if` option](https://sno.phy.queensu.ca/~phil/exiftool/exiftool_pod.html#if-NUM-EXPR) like this `-if "$NumChannels==2"` or `-if "$NumChannels>1"` to get a specific list of files that don't meet the criteria. But exiftool doesn't have a way to compare one file to another. If you are unsure of the number of channels to start with, you would need to script. – StarGeek Jul 02 '19 at 15:53

1 Answers1

0

You'd have to do it externally (via a file or your shell controls or something.

e.g., in bash:

if [ "$(exiftool -NUMCHANNELS a.wav)" == "$(exiftool -NUMCHANNELS b.wav)" ]
then
    echo match
fi

To see if many files all match, you could do something like

exiftool -q -NUMCHANNELS *.wav | uniq | wc -l

And verify the output is 1

L. Scott Johnson
  • 4,213
  • 2
  • 17
  • 28