Commit dc282c52 authored by Ralph Giles's avatar Ralph Giles
Browse files

improve untuned sample rate warnings

svn path=/trunk/vorbis-tools/; revision=1860
parent 0029969b
......@@ -285,9 +285,10 @@ int aiff_open(FILE *in, oe_enc_opt *opt, unsigned char *buf, int buflen)
{
/* From here on, this is very similar to the wav code. Oh well. */
if(format.rate != 44100)
fprintf(stderr,"Warning: Vorbis is currently untuned for input\n"
"at other than 44.1kHz, quality may be degraded.\n");
if(format.rate != 44100 && format.rate != 48000)
fprintf(stderr, "Warning: Vorbis is not currently tuned for this input (%.3f kHz).\n"
" At other than 44.1/48 kHz quality will be degraded.\n",
(float)format.rate * 1.0e-3);
opt->rate = format.rate;
opt->channels = format.channels;
......@@ -413,10 +414,11 @@ int wav_open(FILE *in, oe_enc_opt *opt, unsigned char *oldbuf, int buflen)
if( format.align == format.channels*samplesize &&
format.samplesize == samplesize*8)
{
if(format.samplerate != 44100)
fprintf(stderr, "Warning: Vorbis is currently not tuned for input\n"
" at other than 44.1kHz. Quality may be somewhat\n"
" degraded.\n");
if(format.samplerate != 44100 && format.samplerate != 48000)
fprintf(stderr, "Warning: Vorbis is not currently tuned for this input (%.3f kHz).\n"
" At other than 44.1/48 kHz quality will be degraded.\n",
(float)format.samplerate * 1.0e-3);
/* OK, good - we have the one supported format,
now we want to find the size of the file */
opt->rate = format.samplerate;
......@@ -553,9 +555,10 @@ int raw_open(FILE *in, oe_enc_opt *opt)
wav_fmt format; /* fake wave header ;) */
wavfile *wav = malloc(sizeof(wavfile));
if(opt->rate != 44100)
fprintf(stderr,"Warning: Vorbis is currently untuned for input\n"
"at other than 44.1kHz, quality may be degraded.\n");
if(opt->rate != 44100 && opt->rate != 48000)
fprintf(stderr, "Warning: Vorbis is not currently tuned for this input (%.3f kHz).\n"
" At other than 44.1/48 kHz quality will be significantly degraded.\n",
(float)opt->rate * 1.0e-3);
/* construct fake wav header ;) */
format.format = 2;
......
......@@ -538,12 +538,12 @@ void parse_options(int argc, char **argv, oe_options *opt)
if (opt->rawmode != 1)
{
opt->rawmode = 1;
fprintf(stderr, "WARNING: Raw samplerate specified for non-raw data. Assuming input is raw.\n");
fprintf(stderr, "WARNING: Raw sample rate specified for non-raw data. Assuming input is raw.\n");
}
if(sscanf(optarg, "%u", &opt->raw_samplerate) != 1)
{
opt->raw_samplerate = 44100; /* Failed, so just set to 44100 */
fprintf(stderr, "WARNING: Invalid samplerate specified, assuming 44100.\n");
fprintf(stderr, "WARNING: Invalid sample rate specified, assuming 44100.\n");
}
break;
case '?':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment