Find All MP4 Files With DTS or AC3/A52 Audio?
I made a shell script. This will print any file that has a different codec.
Set the directory and extension to look for.

#!/bin/zsh
directory=~/Music
extension=m4a
codec=aac

find $directory -type f -name "*.$extension" -print0 | while read -d $'\0' file
do
    file_codec="$(ffprobe -v quiet -show_streams -print_format json $file | jq '.streams[0].codec_name')"
    [[ "${file_codec//\"}" != $codec ]] &amp;&amp; echo $file
done


You need ffmpeg and jq. You can install both of them from homebrew.