</TR>
<TR>
<TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
- <TT>--force-raw-input</TT>
+ <TT>--force-raw-format</TT>
</TD>
<TD>
Treat the input file (or output file if decoding) as a raw file, regardless of the extension.
.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng <steve@ggi-project.org>.
-.TH "FLAC" "1" "19 August 2002" "" ""
+.TH "FLAC" "1" "20 August 2002" "" ""
.SH NAME
flac \- Free Lossless Audio Codec
.SH SYNOPSIS
\fB--sign={\fIsigned\fB|\fIunsigned\fB}\fR
Set the sign of samples (the default is signed).
.TP
-\fB--force-raw-input\fR
-Force input to be treated as raw samples (even if filename ends
+\fB--force-raw-format\fR
+Force input (when encoding) or output (when decoding)
+to be treated as raw samples (even if filename ends
in \fI.wav\fR).
.SS "NEGATIVE OPTIONS"
.TP
<!ENTITY dhfirstname "<firstname>Matt</firstname>">
<!ENTITY dhsurname "<surname>Zimmerman</surname>">
<!-- Please adjust the date whenever revising the manpage. -->
- <!ENTITY dhdate "<date>August 19, 2002</date>">
+ <!ENTITY dhdate "<date>August 20, 2002</date>">
<!-- SECTION should be 1-8, maybe w/ subsection other parameters are
allowed: see man(7), man(1). -->
<!ENTITY dhsection "<manvolnum>1</manvolnum>">
</varlistentry>
<varlistentry>
- <term><option>--force-raw-input</option></term>
+ <term><option>--force-raw-format</option></term>
<listitem>
- <para>Force input to be treated as raw samples (even if filename ends
+ <para>Force input (when encoding) or output (when decoding)
+ to be treated as raw samples (even if filename ends
in <filename>.wav</filename>).</para>
</listitem>
</varlistentry>
{ "fast", 0, 0, '0' },
{ "super-secret-impractical-compression-level", 0, 0, 0 },
{ "verify", 0, 0, 'V' },
- { "force-raw-input", 0, 0, 0 },
+ { "force-raw-format", 0, 0, 0 },
{ "lax", 0, 0, 0 },
{ "sector-align", 0, 0, 0 },
{ "seekpoint", 1, 0, 'S' },
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.mode_decode) {
+ if(!option_values.force_raw_format) {
+ if(option_values.format_is_big_endian >= 0)
+ return usage_error("ERROR: --endian only allowed with --force-raw-format\n");
+ if(option_values.format_is_unsigned_samples >= 0)
+ return usage_error("ERROR: --sign only allowed with --force-raw-format\n");
+ }
+ if(option_values.format_channels >= 0)
+ return usage_error("ERROR: --channels not allowed with --decode\n");
+ if(option_values.format_bps >= 0)
+ return usage_error("ERROR: --bps not allowed with --decode\n");
+ if(option_values.format_sample_rate >= 0)
+ return usage_error("ERROR: --sample-rate not allowed with --decode\n");
+ }
if(!option_values.mode_decode && ((unsigned)option_values.blocksize < FLAC__MIN_BLOCK_SIZE || (unsigned)option_values.blocksize > FLAC__MAX_BLOCK_SIZE)) {
return usage_error("ERROR: invalid blocksize '%u', must be >= %u and <= %u\n", (unsigned)option_values.blocksize, FLAC__MIN_BLOCK_SIZE, FLAC__MAX_BLOCK_SIZE);
}
option_values.qlp_coeff_precision = 0;
option_values.skip = 0;
option_values.format_is_big_endian = -1;
- option_values.format_is_unsigned_samples = false;
+ option_values.format_is_unsigned_samples = -1;
option_values.format_channels = -1;
option_values.format_bps = -1;
option_values.format_sample_rate = -1;
option_values.rice_parameter_search_dist = 0;
option_values.max_lpc_order = 32;
}
- else if(0 == strcmp(long_option, "force-raw-input")) {
+ else if(0 == strcmp(long_option, "force-raw-format")) {
option_values.force_raw_format = true;
}
else if(0 == strcmp(long_option, "lax")) {
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-raw-input Force input to be treated as raw samples\n");
+ printf(" --force-raw-format Treat input or output as raw samples\n");
printf("negative options:\n");
printf(" --no-adaptive-mid-side\n");
printf(" --no-decode-through-errors\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-raw-input Force input to be treated as raw samples\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");
printf(" --no-adaptive-mid-side\n");
printf(" --no-decode-through-errors\n");
}
if(fmt == RAW) {
- if(option_values.format_is_big_endian < 0 || option_values.format_channels < 0 || option_values.format_bps < 0 || option_values.format_sample_rate < 0)
- return usage_error("ERROR: for encoding a raw file you must specify a value for --endian, --channels, --bps, and --sample-rate\n");
+ if(option_values.format_is_big_endian < 0 || option_values.format_is_unsigned_samples < 0 || option_values.format_channels < 0 || option_values.format_bps < 0 || option_values.format_sample_rate < 0)
+ return usage_error("ERROR: for encoding a raw file you must specify a value for --endian, --sign, --channels, --bps, and --sample-rate\n");
}
if(encode_infile == stdin || option_values.force_to_stdout)
decode_options_t common_options;
if(!option_values.test_only && !option_values.analyze) {
- if(option_values.force_raw_format && option_values.format_is_big_endian < 0)
- return usage_error("ERROR: for decoding to a raw file you must specify a value for --endian\n");
+ if(option_values.force_raw_format && (option_values.format_is_big_endian < 0 || option_values.format_is_unsigned_samples < 0))
+ return usage_error("ERROR: for decoding to a raw file you must specify a value for --endian and --sign\n");
}
if(0 == strcmp(infilename, "-") || option_values.force_to_stdout)
encode_options="$4"
echo -n "$name: encode..."
- cmd="flac --verify --silent --force-raw-input --endian=big --sample-rate=44100 --bps=$bps --channels=$channels $encode_options $name.bin"
+ cmd="flac --verify --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=$bps --channels=$channels $encode_options $name.bin"
echo "### ENCODE $name #######################################################" >> ./streams.log
echo "### cmd=$cmd" >> ./streams.log
if $cmd 2>>./streams.log ; then : ; else
exit 1
fi
echo -n "decode..."
- cmd="flac --silent --endian=big --decode --force-raw-input $name.flac";
+ cmd="flac --silent --endian=big --decode --force-raw-format $name.flac";
echo "### DECODE $name #######################################################" >> ./streams.log
echo "### cmd=$cmd" >> ./streams.log
if $cmd 2>>./streams.log ; then : ; else
if [ $? != 0 ] ; then exit 1 ; fi
echo "Generating stream..."
-if flac --verify -0 --output-name=$flacfile --force-raw-input --endian=big --channels=1 --bps=8 --sample-rate=44100 /bin/sh ; then
+if flac --verify -0 --output-name=$flacfile --force-raw-format --endian=big --sign=signed --channels=1 --bps=8 --sample-rate=44100 /bin/sh ; then
chmod +w $flacfile
else
echo "ERROR during generation" 1>&2
# multi-file tests
#
echo "Generating multiple input files from noise..."
-if flac --verify --silent --force-raw-input --endian=big --sample-rate=44100 --bps=16 --channels=2 noise.raw ; then : ; else
+if flac --verify --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=16 --channels=2 noise.raw ; then : ; else
echo "ERROR generating FLAC file" 1>&2
exit 1
fi
encode_options="$4"
echo -n "$name: encode..."
- cmd="flac --verify --silent --force-raw-input --endian=big --sample-rate=44100 --bps=$bps --channels=$channels $encode_options $name.raw"
+ cmd="flac --verify --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=$bps --channels=$channels $encode_options $name.raw"
echo "### ENCODE $name #######################################################" >> ./streams.log
echo "### cmd=$cmd" >> ./streams.log
if $cmd 2>>./streams.log ; then : ; else
exit 1
fi
echo -n "decode..."
- cmd="flac --silent --endian=big --decode --force-raw-input --output-name=$name.cmp $name.flac"
+ cmd="flac --silent --endian=big --decode --force-raw-format --output-name=$name.cmp $name.flac"
echo "### DECODE $name #######################################################" >> ./streams.log
echo "### cmd=$cmd" >> ./streams.log
if $cmd 2>>./streams.log ; then : ; else
echo -n "$name: encode via pipes..."
if [ $is_win = yes ] ; then
- cmd="flac --verify --silent --force-raw-input --endian=big --sample-rate=44100 --bps=$bps --channels=$channels $encode_options --stdout $name.raw"
+ cmd="flac --verify --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=$bps --channels=$channels $encode_options --stdout $name.raw"
echo "### ENCODE $name #######################################################" >> ./streams.log
echo "### cmd=$cmd" >> ./streams.log
if $cmd 1>$name.flac 2>>./streams.log ; then : ; else
exit 1
fi
else
- cmd="flac --verify --silent --force-raw-input --endian=big --sample-rate=44100 --bps=$bps --channels=$channels $encode_options --stdout -"
+ cmd="flac --verify --silent --force-raw-format --endian=big --sign=signed --sample-rate=44100 --bps=$bps --channels=$channels $encode_options --stdout -"
echo "### ENCODE $name #######################################################" >> ./streams.log
echo "### cmd=$cmd" >> ./streams.log
if cat $name.raw | $cmd 1>$name.flac 2>>./streams.log ; then : ; else
fi
echo -n "decode via pipes..."
if [ $is_win = yes ] ; then
- cmd="flac --silent --endian=big --decode --force-raw-input --stdout $name.flac"
+ cmd="flac --silent --endian=big --decode --force-raw-format --stdout $name.flac"
echo "### DECODE $name #######################################################" >> ./streams.log
echo "### cmd=$cmd" >> ./streams.log
if $cmd 1>$name.cmp 2>>./streams.log ; then : ; else
exit 1
fi
else
- cmd="flac --silent --endian=big --decode --force-raw-input --stdout -"
+ cmd="flac --silent --endian=big --decode --force-raw-format --stdout -"
echo "### DECODE $name #######################################################" >> ./streams.log
echo "### cmd=$cmd" >> ./streams.log
if cat $name.flac | $cmd 1>$name.cmp 2>>./streams.log ; then : ; else