{ "fast", 0, 0, '0' },
{ "super-secret-totally-impractical-compression-level", 0, 0, 0 },
{ "verify", 0, 0, 'V' },
+ { "force-aiff-format", 0, 0, 0 },
{ "force-raw-format", 0, 0, 0 },
{ "lax", 0, 0, 0 },
{ "replay-gain", 0, 0, 0 },
FLAC__bool do_escape_coding;
FLAC__bool do_qlp_coeff_prec_search;
FLAC__bool force_to_stdout;
+ FLAC__bool force_aiff_format;
FLAC__bool force_raw_format;
FLAC__bool delete_input;
FLAC__bool replay_gain;
if(!FLAC__format_sample_rate_is_valid(option_values.format_sample_rate))
return usage_error("ERROR: invalid sample rate '%u', must be > 0 and <= %u\n", option_values.format_sample_rate, FLAC__MAX_SAMPLE_RATE);
}
+ if(option_values.force_raw_format && option_values.force_aiff_format)
+ return usage_error("ERROR: only one of --force-raw-format and --force-aiff-format allowed\n");
if(option_values.mode_decode) {
if(!option_values.force_raw_format) {
if(option_values.format_is_big_endian >= 0)
option_values.do_escape_coding = false;
option_values.do_qlp_coeff_prec_search = false;
option_values.force_to_stdout = false;
+ option_values.force_aiff_format = false;
option_values.force_raw_format = false;
option_values.delete_input = false;
option_values.replay_gain = false;
option_values.rice_parameter_search_dist = 0;
option_values.max_lpc_order = 32;
}
+ else if(0 == strcmp(long_option, "force-aiff-format")) {
+ option_values.force_aiff_format = true;
+ }
else if(0 == strcmp(long_option, "force-raw-format")) {
option_values.force_raw_format = true;
}
printf(" --bps=# Number of bits per sample\n");
printf(" --sample-rate=# Sample rate in Hz\n");
printf(" --sign={signed|unsigned} Sign of samples\n");
+ printf(" --force-aiff-format Force decoding to AIFF format\n");
printf(" --force-raw-format Treat input or output as raw samples\n");
printf("negative options:\n");
printf(" --no-adaptive-mid-side\n");
printf(" --bps=# Number of bits per sample\n");
printf(" --sample-rate=# Sample rate in Hz\n");
printf(" --sign={signed|unsigned} Sign of samples (the default is signed)\n");
+ printf(" --force-aiff-format Force the decoder to output AIFF format. This\n");
+ printf(" option is not needed if the output filename (as\n");
+ printf(" set by -o) ends with .aiff; this option has no\n");
+ printf(" effect when encoding since input AIFF is auto-\n");
+ printf(" detected.\n");
printf(" --force-raw-format Force input (when encoding) or output (when\n");
printf(" decoding) to be treated as raw samples\n");
printf("negative options:\n");
options.common = common_options;
- retval = flac__decode_wav(infilename, option_values.test_only? 0 : outfilename, option_values.analyze, option_values.aopts, options);
+ if(
+ option_values.force_aiff_format ||
+ (strlen(outfilename) > 3 && 0 == strcasecmp(outfilename+(strlen(outfilename)-4), ".aif")) ||
+ (strlen(outfilename) > 4 && 0 == strcasecmp(outfilename+(strlen(outfilename)-5), ".aiff"))
+ )
+ retval = flac__decode_aiff(infilename, option_values.test_only? 0 : outfilename, option_values.analyze, option_values.aopts, options);
+ else
+ retval = flac__decode_wav(infilename, option_values.test_only? 0 : outfilename, option_values.analyze, option_values.aopts, options);
}
else {
raw_decode_options_t options;
strcpy(buffer, "-");
}
else {
- static const char *suffixes[] = { ".wav", ".raw", ".ana" };
- const char *suffix = suffixes[option_values.analyze? 2 : option_values.force_raw_format? 1 : 0];
+ static const char *suffixes[] = { ".wav", ".aiff", ".raw", ".ana" };
+ const char *suffix = suffixes[
+ option_values.analyze? 3 :
+ option_values.force_raw_format? 2 :
+ option_values.force_aiff_format? 1 :
+ 0
+ ];
char *p;
strcpy(buffer, option_values.output_prefix? option_values.output_prefix : "");
strcat(buffer, infilename);