Support decoding directly to .aifc - #920
Open
madah81pnz1 wants to merge 1 commit into
Open
Conversation
Fixes so that flac doesn't default to WAVE for .aifc extension
madah81pnz1
commented
Jul 19, 2026
| input_format = FORMAT_AIFF; | ||
| else if(infilename_length >= 5 && 0 == FLAC__STRCASECMP(infilename+(infilename_length-5), ".aiff")) | ||
| input_format = FORMAT_AIFF; | ||
| else if(infilename_length >= 5 && 0 == FLAC__STRCASECMP(infilename + (infilename_length - 5), ".aifc")) |
Contributor
Author
There was a problem hiding this comment.
I wanted to add a test for this in test_flac.sh, and it turns out we already have this for aiff:
convert_to_aiff ()
{
run_flac "$2" $1.raw || die "ERROR converting $1.raw to AIFF"
run_flac "$3" $1.flac -o $1.aiff || die "ERROR converting $1.raw to AIFF"
}
However, adding .aifc here in the same way would still pass even without this commit, since there is nothing that checks that the actual output file is AIFF or AIFF-C; the test would still pass but we get a WAV file with a .aifc file extension.
Maybe there is a portable way to use file to check what format the output file actually is, I can try to add it in next commit. File would return one of IFF data, AIFF audio, IFF data, AIFF-C compressed audio, RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 44100 Hz, so grepping for "AIFF audio", "AIFF-C" or "WAVE audio" should do the trick.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes so that flac doesn't default to WAVE for .aifc extension