flac icon indicating copy to clipboard operation
flac copied to clipboard

Add (for --test): -R --Recurse Subdirectories / -L --List

Open isidroco opened this issue 2 years ago • 6 comments

Flac.exe could be greatly improved adding -R (--Recurse) to include subdirs in --test (and maybe also in encode/decode). Another useful addition would be to have a .txt containing the list of files to process (which may include full path to other folders): -L --List <filelist.txt>

isidroco avatar Sep 24 '22 23:09 isidroco

This is something uncommon in similar other tools. What about using something like flac -t *.flac */*.flac */*/*.flac?

ktmf01 avatar Sep 28 '22 09:09 ktmf01

What about using something like flac -t *.flac */*.flac */*/*.flac?

Doesn't work on windows. Audiotester.exe from www.vuplayer.com is a workaround. Recurse subdirectories is very common on other tools (zip, rar, 7z, etc). Checking all files under a given tree is something basic to do.

isidroco avatar Sep 29 '22 21:09 isidroco

The problem here is that zip, rar and 7z can compress all kinds of files. FLAC can only handle audio files. Also, they pack all those files into a single archive while FLAC converts one file into another.

Suppose you have a directory 'Music' with a directory tree containing mostly FLAC files, JPG cover art, some Ogg Vorbis and some MP3 files. You want to test all FLAC files in the directory. On unix systems you would simply run find . -iname \*.flac -print0 | xargs -0 flac -t. On Windows Powershell something similar is possible.

How do you think this -R option should work? Should you just use flac -t -R Music and should FLAC figure out it must only test *.flac files? Or should it also assume the Ogg contain FLAC audio and return an error on trying to decode the Ogg Vorbis files? Or should it try all files it finds and return on errors on everything that is not FLAC?

How should it work on encoding? Should it encode all *.wav, *.aiff, *.rf64 and *.w64 it finds and skip *.flac and *.ogg? Or should it try to recompress *.flac and *.ogg files?

You see, this gets complicated rather quickly when using wildcards to specify what you want are not a possibility.

ktmf01 avatar Sep 30 '22 14:09 ktmf01

You see, this gets complicated rather quickly when using wildcards to specify what you want are not a possibility.

You are complicating things, on 7z is the same, just repeat whatever was typed on specified folder and it's subfolders. Examples: Test all flacs under current folder:
FLAC.EXE-t -R *.flac Move all WAVs to flac under D:\Music and drive E:\ : FLAC.EXE -8 --delete-input-file -R D:\Music\*.wav E:\*.wav

As it's working now, flac also needs input file[s] specified, your examples don't specify Sources. And why one would have to make a Powershell script (not always installed) to do something basic that should be included on FLAC.EXE ? Eventually, if -R is used, Source could be limited to only one element if recursing all of them is confusing, but it doesn't seem difficult to implement.

isidroco avatar Oct 04 '22 00:10 isidroco

I just found out about a way to do this in Windows (didn't know, don't use the Windows shell very often)

for /r %i in (*.flac) do flac.exe -st "%i"

If you want a list just do

for /r %i in (*.flac) do echo %i

ktmf01 avatar Nov 01 '22 07:11 ktmf01

I just found out about a way to do this in Windows (didn't know, don't use the Windows shell very often)

That is useless because first results get buried, and it's difficult to find an error. Unless redirected to a text file: for /r %i in (*.flac) do flac.exe -st "%i" >test.txt But in that case progress can't be seen, and it's slower as one instance of flac.exe must be called for each .flac in drive. Besides it's harder to do.

isidroco avatar Nov 01 '22 14:11 isidroco