How to find untagged audio files?

Yes,
I should confess that I have completely forgotten that in awk arrays are passed by reference when used as parameters :slight_smile:
I was about to respond that you can do it in Perl, but not in awk.

Yes, you can:

find . -type f -name '*.[Mm][Pp]3' -exec id3 -Rl {} + -o \
               -name '*.[Ff][Ll][Aa][Cc]' -exec metaflac --show-md5sum \
                  --with-filename --export-tags-to=- {} + -o \
               -name '*.[Oo][Gg][Gg]' -exec sh -c 'echo "$0";vorbiscomment -lRe "$0"' {} \; |
  awk 'BEGIN {
    id3n        = split("album artist title track",          id3_tags)
    vorbisn     = split("album artist title tracknumber", vorbis_tags)
    vorbisfile  = "\\.([Ff][Ll][Aa][Cc]|[Oo][Gg][Gg])$"    
    ignorepatt  = "^ *(unknown|track *[0-9]*)* *$"    
    }
  
  /^Filename/ || $1 ~ vorbisfile {
    if (fn)
      fn ~ vorbisfile ? check_tags(vorbisn, vorbis_tags) : check_tags(id3n, id3_tags)
    fn = /^Filename/ ? $2 : $1; f = x        
     }
  
  { 
    if (split($0, tmp, "=") == 2) { $1 = tmp[1]; $2 = tmp[2] }
    tags[tolower($1)] = $2 
      }
  
  END { fn ~ vorbisfile ? check_tags(vorbisn, vorbis_tags) : check_tags(id3n, id3_tags)  
      printf "\n"
      }
  
  func check_tags(limit, tagarray,    f) {
   for (i = 1; i <= limit; i++) {
      if (tolower(tags[tagarray]) ~ ignorepatt) {
        invalid_tags[tagarray] = tags[tagarray]; f || f++ 
        }
      }
    if (f) {
      printf "%s%s *** missing/invalid tags: ", RS, fn
        for (t in invalid_tags)
          printf "[%s=\"%s\"]", t, invalid_tags[t]
      printf " ***"  
      }    
    split(x, tags); split(x, invalid_tags)
    
    }' FS=:

To clear the output further, you could remove the empty spaces in the missing tags.