[Audacity-devel] Patch to stop batch export to MP3 becoming mono always
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
|
From: Bo B. <bo....@te...> - 2005-12-27 21:00:34
|
Hi all,
this is my first post to this list, which I believe is the right place
to submit code modifications.
I had to fix the 1.3.0 codeline in order to make the batch processing
useable for my purposes. I want to normalize the volume of a number of
MP3 files that I have ripped from 1/4" tape a year ago (and since gotten
rid of the tape recorder and all of the tapes as well).
But when I tested the 1.3.0b version of the batch processing I discovered
that it *always* produced mono output files even though the Stereo-to-Mono
effect was not part of the processing chain.
After asking a few days on the forums I decided to fix it myself and
downloaded the sources from CVS.
I soon discovered that the call to ExportMP3 has been
hardcoded with a false for the stereo argument and then of course lame
will make a mono file no matter what...
I could change this to true to make it do the opposite but I felt it
would be better to use a parameter that the user can access in the batch
configuration, so I did so instead.
Now with the patch below the output MP3 will be stereo by default but
can be mono provieded that the MP3 export step in the batch config has
a parameter "Mono=yes". This has to be entered by hand now, there is no
parameter editor available, but it will work this way.
One final note:
When I applied this patch to the HEAD revision in CVS it did not work
properly. The batch processing itself stops after one file has been
treated. It looks like some other change has broken the iterations
through the file list.
So I updated to the audacity_1-3-0_branch instead and rebuilt using these
sources and now everything works as expected. Note that the files involved
in my changes are the same revision on TRUNK and in the branch, so whatever
causes the batch loop to not work is elsewhere in somebody else's code
changes....
Index: BatchCommands.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/BatchCommands.cpp,v
retrieving revision 1.6
diff -r1.6 BatchCommands.cpp
237c237,238
< return ::ExportMP3(project, false, Name, false, 0.0, endTime);
---
> // Use mMp3Stereo to control if export is to a stereo or mono file
> return ::ExportMP3(project, mMp3Stereo, Name, false, 0.0, endTime);
243c244,245
< rc = ::ExportMP3(project, false, Name, false, 0.0, endTime);
---
> // Use mMp3Stereo to control if export is to a stereo or mono file
> rc = ::ExportMP3(project, mMp3Stereo, Name, false, 0.0, endTime);
293a296
> mMp3Stereo = !(params == wxT("Mono=yes")); //Should be created in a
proper editor
Index: BatchCommands.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/BatchCommands.h,v
retrieving revision 1.2
diff -r1.2 BatchCommands.h
56a57,59
>
> // Use mMp3Stereo to control if export is to a stereo or mono file
> bool mMp3Stereo;
***** CVS exited normally with code 1 *****
cvs diff -- BatchCommands.h (in directory
F:\Engineering\Projects\audacity\src\)
Index: BatchCommands.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/BatchCommands.h,v
retrieving revision 1.2
diff -r1.2 BatchCommands.h
56a57,59
>
> // Use mMp3Stereo to control if export is to a stereo or mono file
> bool mMp3Stereo;
Best Regards,
Bo Berglund
|