I'm looking for someone to help me create a bash script using the mediainfo
tool to loop through my entire audio library and output a list of .flac files that do not have a Sampling rate
of "44.1 kHz" or a Bit depth
of "16 bits".
I gave it a shot, but it doesn't run. Here's where my head was at.
#!/usr/bin/env sh
mediainfo /media/Media/Music/
if grep ["Bit depth" != "16"] || ["Sampling rate" != "44.1 kHz"]
then
echo "$flacfile"
echo mediainfo /media/Media/Music/ | grep 'Bit depth'
echo mediainfo /media/Media/Music/ | grep 'Sampling rate'
else
# do nothing...
fi
There is some error in your script: You are using
grep
wrongly, there is no loop on.flac
file,mediainfo
is not stored, and the pipes are used wrongly.With
mediainfo
you could do something like that: