Audio files recursive scanning
Hello everybody!
I've been trying unsucessfuly to write a bash script to scan all my audio file collection in order to find which files has a lyrics frame empty (or unsetted), the script use kid3-cli in the follow form:
elliot@mrrobot:~/Music/Various Artists/2006 American Hardcore$ kid3-cli -c "select \"01 Nervous Breakdown.mp3\"" -c "get lyrics"
which works perfectly fine in the command line, fetching the lyrics frame and displaying it in the console. But I want to do this, not just over all the file in a folder, but all the files in the subfolders and subsubfolders, a whole scanning directory. So I wrote something like this (I deleted the log file codelines on porpouse, it's not relevant here):
#!/bin/bash
path=$1;
find "$path" -name "*.mp3" -print0 |
while read -r -d $'\0' audio_file;
do
echo "\$audio_file=$audio_file";
lyric=$(kid3-cli -c "select \"$audio_file\"" -c "get lyrics");
echo "\$lyric=$lyric";
done;
The problem here is the script only works if the argument is a directory with mp3, but not if the argument is a empty folder, containing subfolders containg mp3 files. The $audio_file variable shows the right path, but the $lyric variable is empty.
I thought it could be something in the while loop (it's kind of tricky) so getting back to the bare kid3-cli command I try it again using the absolute path to the mp3 file:
elliot@mrrobot:~$ kid3-cli -c "select \"/home/charles/Music/Various Artists/2006 American Hardcore/01 Nervous Breakdown.mp3\"" -c "get lyrics"
Now, this returns nothing at all.
Is this a kid3-cli issue? I think it could be.
Imported from SourceForge, author: abilli