The Converter class implements the conversion of an MPEG audio file to a .WAV file. To convert an MPEG audio stream, just create an instance of this class and call the {@link convert() convert()} method, passing in the names of the input and output files. You can pass in optional ProgressListener and Decoder.Params objects also to customize the conversion. *
Exemplo n.º 1
0
        public static void Main(System.String[] args)
        {
            System.String[] argv;
            long start = (System.DateTime.Now.Ticks - 621355968000000000) / 10000;
            int argc = args.Length + 1;
            argv = new System.String[argc];
            argv[0] = "jlc";
            for (int i = 0; i < args.Length; i++)
                argv[i + 1] = args[i];

            jlcArgs ma = new jlcArgs();
            if (!ma.processArgs(argv))
                System.Environment.Exit(1);

            Converter conv = new Converter();

            int detail = (ma.verbose_mode?ma.verbose_level:Converter.PrintWriterProgressListener.NO_DETAIL);

            System.IO.StreamWriter temp_writer;
            //UPGRADE_ISSUE: 'java.lang.System.out' was converted to 'System.Console.Out' which is not valid in this expression. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1109"'
            temp_writer = new System.IO.StreamWriter(System.Console.Out);
            temp_writer.AutoFlush = true;
            Converter.ProgressListener listener = new Converter.PrintWriterProgressListener(temp_writer, detail);

            try
            {
                conv.convert(ma.filename, ma.output_filename, listener);
            }
            catch (JavaLayerException ex)
            {
                System.Console.Error.WriteLine("Convertion failure: " + ex);
            }

            System.Environment.Exit(0);
        }