1 /* $Id: mp3x.c,v 1.28 2010/04/08 11:07:50 robert Exp $ */
12 #include "lame-analysis.h"
15 #include "get_audio.h"
23 /************************************************************************
27 * PURPOSE: MPEG-1,2 Layer III encoder with GPSYCHO
28 * psychoacoustic model.
30 ************************************************************************/
32 lame_main(lame_t gf, int argc, char **argv)
34 unsigned char mp3buffer[LAME_MAXMP3BUFFER];
35 char outPath[PATH_MAX + 1];
36 char inPath[PATH_MAX + 1];
39 lame_set_errorf(gf, &frontend_errorf);
40 lame_set_debugf(gf, &frontend_debugf);
41 lame_set_msgf(gf, &frontend_msgf);
43 usage(stderr, argv[0]); /* no command-line args */
46 ret = parse_args(gf, argc, argv, inPath, outPath, NULL, NULL);
48 return ret == -2 ? 0 : 1;
50 (void) lame_set_analysis(gf, 1);
52 if (init_infile(gf, inPath) < 0) {
53 error_printf("Can't init infile '%s'\n", inPath);
57 lame_print_config(gf);
59 gtk_init(&argc, &argv);
60 gtkcontrol(gf, inPath);
62 lame_encode_flush(gf, mp3buffer, sizeof(mp3buffer));