summaryrefslogtreecommitdiff
path: root/tools/rbspeex/rbspeexenc.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/rbspeex/rbspeexenc.c')
-rw-r--r--tools/rbspeex/rbspeexenc.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/rbspeex/rbspeexenc.c b/tools/rbspeex/rbspeexenc.c
index 7869602f44..d3c3f7712c 100644
--- a/tools/rbspeex/rbspeexenc.c
+++ b/tools/rbspeex/rbspeexenc.c
@@ -30,7 +30,7 @@
30" -c x Complexity, increases quality for a given bitrate, but encodes\n"\ 30" -c x Complexity, increases quality for a given bitrate, but encodes\n"\
31" slower, range [0-10], default 3\n"\ 31" slower, range [0-10], default 3\n"\
32" -n Enable narrowband mode, will resample input to 8 kHz\n\n"\ 32" -n Enable narrowband mode, will resample input to 8 kHz\n\n"\
33" -v x Volume, amplitude multiplier, default 1.0.\n"\ 33" -v x Volume, amplitude multiplier, default 1.0\n"\
34"rbspeexenc expects a mono 16 bit WAV file as input. Files will be resampled\n"\ 34"rbspeexenc expects a mono 16 bit WAV file as input. Files will be resampled\n"\
35"to either 16 kHz by default, or 8 kHz if narrowband mode is enabled.\n"\ 35"to either 16 kHz by default, or 8 kHz if narrowband mode is enabled.\n"\
36"WARNING: This tool will create files that are only usable by Rockbox!\n" 36"WARNING: This tool will create files that are only usable by Rockbox!\n"
@@ -146,6 +146,10 @@ int main(int argc, char **argv)
146 volume = atof(argv[++i]); 146 volume = atof(argv[++i]);
147 else if (strncmp(argv[i], "-n", 2) == 0) 147 else if (strncmp(argv[i], "-n", 2) == 0)
148 narrowband = true; 148 narrowband = true;
149 else {
150 printf("Error: unrecognized option '%s'\n", argv[i]);
151 return 1;
152 }
149 ++i; 153 ++i;
150 } 154 }
151 155
@@ -210,7 +214,10 @@ int main(int argc, char **argv)
210 214
211 speex_bits_init(&bits); 215 speex_bits_init(&bits);
212 inpos = in; 216 inpos = in;
213 fout = fopen(argv[argc - 1], "wb"); 217 if ((fout = fopen(argv[argc - 1], "wb")) == NULL) {
218 printf("Error: could not open output file\n");
219 return 1;
220 }
214 221
215 while (numsamples > 0) { 222 while (numsamples > 0) {
216 int samples = frame_size; 223 int samples = frame_size;