audacity - convert multiple .aup's to .mp3's

3

I have a bunch of about 130 .aup files (all recordings of vinyls) that I would like to convert to mp3. Each .aup is an entire side of the vinyl (I don't want to split the tracks - the whole side as one mp3 is fine). My problem is how can i batch convert all these aups to mp3s in one go. It would be very tedious to open each .aup one at a time then in the Apply Chain dialog: select 'Apply to Current Project' for 130 files..one by one.

Has anyone had any luck changing the code, or otherwise to come up with a solution?

I've traced it down to the below method in (BatchProcessDialog.cpp)

void BatchProcessDialog::OnApplyToProject(wxCommandEvent &event)
{
   long item = mChains->GetNextItem(-1,
                                    wxLIST_NEXT_ALL,
                                    wxLIST_STATE_SELECTED);
   if (item == -1) {
      wxMessageBox(_("No chain selected"));
      return;
   }
   wxString name = mChains->GetItemText(item);

   wxDialog d(this, wxID_ANY, GetTitle());
   ShuttleGui S(&d, eIsCreating);

   S.StartHorizontalLay(wxCENTER, false);
   {
      S.StartStatic(wxT(""), false);   // deliberately not translated (!)
      {
         S.SetBorder(20);
         S.AddFixedText(wxString::Format(_("Applying '%s' to current project"),
                                         name.c_str()));
      }
      S.EndStatic();
   }
   S.EndHorizontalLay();

   d.Layout();
   d.Fit();
   d.CenterOnScreen();
   d.Move(-1, 0);
   d.Show();
   Hide();

   wxWindowDisabler wd;

   gPrefs->Write(wxT("/Batch/ActiveChain"), name);

   mBatchCommands.ReadChain(name);
   if (!mBatchCommands.ApplyChain()) {
      return;
   }
}

toop

Posted 2012-01-30T11:01:41.820

Reputation: 335

Answers

2

I decided to roll my own script in autohotkey (it is a bit unstable, but can get through a few files at a time):

SetTitleMatchMode 2
#p::Pause

#x::Exit

#a::
direc = C:\Documents and Settings\Test\My Documents\myaups\
FileList =  ; Initialize to be blank.
Loop, %direc%*.aup
    FileList = %FileList%%A_LoopFileName%`n
Loop, parse, FileList, `n
{
    Sleep 2500
    Run, "C:\Program Files\Audacity 1.3 Beta (Unicode)\audacity.exe"
    Sleep 2500
    WinWait, Audacity, 
    IfWinNotActive, Audacity, , WinActivate, Audacity, 
    WinWaitActive, Audacity,
    if A_LoopField =  ; Ignore the blank item at the end of the list.
        continue
    Sleep 2500
    Send, {CTRLDOWN}o{CTRLUP}
    Sleep 3000
    WinWait, Select one or more audio files..., 
    IfWinNotActive, Select one or more audio files..., , WinActivate, Select one or more audio files..., 
    WinWaitActive, Select one or more audio files..., 
    Sleep, 2800
    Send, %direc%
    Sleep, 2600
    Send, {Enter}
    Sleep, 2600
    Send, %A_LoopField% ;filename from direc loop
    Sleep, 2600
    Send, {Enter}
    Sleep, 4000
    IfWinActive, Warning - Opening Old Project File
    {
    Send, {Enter}
    Sleep, 1000
    }
    Sleep, 3800
    IfWinActive, Warning - Orphan Block File(s)
    {
    Send {Tab}
    Sleep 1000
    Send {Tab}
    Sleep 1000
    Send, {Enter}
    }
    Sleep, 3000
    Send, {SHIFTDOWN}c{SHIFTUP} ;first must set the keyboard shortcut in audacity to Shift+C
    Sleep, 3600
    WinWait, Apply Chain, 
    IfWinNotActive, Apply Chain, , WinActivate, Apply Chain, 
    WinWaitActive, Apply Chain, 
    Sleep 500
    Send, {TAB}{ENTER}
    Sleep 4000
    Loop ;wait till conversion finishes
    {
        if !WinExist("Apply Chain")
            break  ; Terminate the loop
        else
            Sleep 200
    }
    Sleep 3800
    Send, {CTRLDOWN}q{CTRLUP} ;exit audacity
    Sleep, 3800
    WinWait, Save changes?, 
    IfWinNotActive, Save changes?, , WinActivate, Save changes?, 
    WinWaitActive, Save changes?, 
    Sleep 500
    Send, {TAB}{ENTER}
    Sleep 6500
}
Return

toop

Posted 2012-01-30T11:01:41.820

Reputation: 335

1

It's going to be somewhat tricky if you don't have C++ knowledge, as you need to know about the class structure of which the mChains object is instantiated from and call the right functions to chain it.

An alternative might be to script something using AutoIt which emulates the GUI clicks for you.

Tamara Wijsman

Posted 2012-01-30T11:01:41.820

Reputation: 54 163

I took your idea about automating GUI clicks – toop – 2012-02-04T13:19:35.553

0

Audacity (at least recent versions) has in the dialogue from File > Apply Chain... the button Apply to Files... which allows to apply the chain to multiple files at once.

Alex1357

Posted 2012-01-30T11:01:41.820

Reputation: 139