Skip to content

Support decoding directly to .aifc - #920

Open
madah81pnz1 wants to merge 1 commit into
xiph:masterfrom
madah81pnz1:check-file-extension
Open

Support decoding directly to .aifc#920
madah81pnz1 wants to merge 1 commit into
xiph:masterfrom
madah81pnz1:check-file-extension

Conversation

@madah81pnz1

Copy link
Copy Markdown
Contributor

Fixes so that flac doesn't default to WAVE for .aifc extension

Fixes so that flac doesn't default to WAVE for .aifc extension
Comment thread src/flac/main.c
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"))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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

Successfully merging this pull request may close these issues.

1 participant