Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
isidroco opened this issue Sep 24, 2022 · 6 comments
Open

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

isidroco opened this issue Sep 24, 2022 · 6 comments

Comments

@isidroco
Copy link

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>

@ktmf01
Copy link
Collaborator

ktmf01 commented Sep 28, 2022

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

@isidroco
Copy link
Author

isidroco commented Sep 29, 2022

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.

@ktmf01
Copy link
Collaborator

ktmf01 commented Sep 30, 2022

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.

@isidroco
Copy link
Author

isidroco commented Oct 4, 2022

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.

@ktmf01
Copy link
Collaborator

ktmf01 commented Nov 1, 2022

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

@isidroco
Copy link
Author

isidroco commented Nov 1, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants