diff options
author | Thom Johansen <thomj@rockbox.org> | 2007-11-28 13:42:44 +0000 |
---|---|---|
committer | Thom Johansen <thomj@rockbox.org> | 2007-11-28 13:42:44 +0000 |
commit | df0df311dc2545d8332b088ad281b1dfeaf0f3c8 (patch) | |
tree | bbd874bdd22a15a56befe5a6529df80e564cfb53 /tools/rbspeex/rbspeexenc.c | |
parent | c1b718403af42203b3eda3272a8850839849c091 (diff) | |
download | rockbox-df0df311dc2545d8332b088ad281b1dfeaf0f3c8.tar.gz rockbox-df0df311dc2545d8332b088ad281b1dfeaf0f3c8.zip |
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.c | 11 |
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; |