summaryrefslogtreecommitdiff
path: root/tools/rbspeex/rbspeexenc.c
diff options
context:
space:
mode:
authorThom Johansen <thomj@rockbox.org>2007-11-28 13:42:44 +0000
committerThom Johansen <thomj@rockbox.org>2007-11-28 13:42:44 +0000
commitdf0df311dc2545d8332b088ad281b1dfeaf0f3c8 (patch)
treebbd874bdd22a15a56befe5a6529df80e564cfb53 /tools/rbspeex/rbspeexenc.c
parentc1b718403af42203b3eda3272a8850839849c091 (diff)
Add rbspeexdec, decoder for the Rockbox voice clips. Also nitpick a bit on rbspeexenc while I'm at it.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15842 a1c6a512-1295-4272-9138-f99709370657
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 @@
" -c x Complexity, increases quality for a given bitrate, but encodes\n"\
" slower, range [0-10], default 3\n"\
" -n Enable narrowband mode, will resample input to 8 kHz\n\n"\
-" -v x Volume, amplitude multiplier, default 1.0.\n"\
+" -v x Volume, amplitude multiplier, default 1.0\n"\
"rbspeexenc expects a mono 16 bit WAV file as input. Files will be resampled\n"\
"to either 16 kHz by default, or 8 kHz if narrowband mode is enabled.\n"\
"WARNING: This tool will create files that are only usable by Rockbox!\n"
@@ -146,6 +146,10 @@ int main(int argc, char **argv)
volume = atof(argv[++i]);
else if (strncmp(argv[i], "-n", 2) == 0)
narrowband = true;
+ else {
+ printf("Error: unrecognized option '%s'\n", argv[i]);
+ return 1;
+ }
++i;
}
@@ -210,7 +214,10 @@ int main(int argc, char **argv)
speex_bits_init(&bits);
inpos = in;
- fout = fopen(argv[argc - 1], "wb");
+ if ((fout = fopen(argv[argc - 1], "wb")) == NULL) {
+ printf("Error: could not open output file\n");
+ return 1;
+ }
while (numsamples > 0) {
int samples = frame_size;