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

flac is inconsistent in when it uses an extension or file magic #777

Open
ktmf01 opened this issue Dec 19, 2024 · 3 comments
Open

flac is inconsistent in when it uses an extension or file magic #777

ktmf01 opened this issue Dec 19, 2024 · 3 comments

Comments

@ktmf01
Copy link
Collaborator

ktmf01 commented Dec 19, 2024

See #763 (comment)_

@H2Swine
Copy link
Contributor

H2Swine commented Dec 19, 2024

I am by no means competent to do anything about the way the command-line tool handles file, but when you have had time to think over what should be done:
Is there any use in updating the flac.md help file to reflect what current git version does?

@H2Swine
Copy link
Contributor

H2Swine commented Dec 21, 2024

Oh, it is maybe not that hard to write - worse is that it might be cumbersome to read and digest. But I think this reflects current reality?

flac will detect input file format from file headers upon encoding
and re-encoding, outputting a FLAC file except overridden by --ogg.
Upon decoding, it will assume that input is a FLAC file (--ogg is
necessary upon decoding an Ogg FLAC file), and can set output file type
either (1) by specifying output name ending in ".wav", ".rf64", ".w64",
".aif" or ".aiff", or (2) by format options, which also can set a
particular version of RIFF WAVE or AIFF, or (3) possibly inferred if
the FLAC file has stored the non-audio chunks of the original source -
such are not stored by default. In the absence of (1) to (3), output
will default to RIFF WAVE. flac makes no further assumptions about
file extensions, though the convention is that FLAC files end with
".flac" (or ".fla" on ancient "8.3" file systems like FAT-16), and that
Ogg FLAC files end with .oga.

Then the second command-line under SYNOPSIS should maybe be as long as this?

flac [ -d | --decode | -t | --test | -a | --analyze ] [ OPTIONS ] [ infile.flac | --ogg infile.oga | --ogg infile.ogg | - ... ]

<edit> removed -v and -h, they don't belong there. But maybe

--ogg infile[.ogg|.oga]

pointing out that extension is optional. (I did not capitalize filename here. man pages like e.g. gzip and xz don't.)
</edit>

If you think they are worth it, I could try to work one or both into flac.md for a PR.

@H2Swine
Copy link
Contributor

H2Swine commented Jan 2, 2025

Hm, what options does -t even take? -w, -s and if applicable --ogg - and then it does ignore a few?

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

No branches or pull requests

2 participants