我有一堆大约 130 个 .aup 文件(所有黑胶唱片的录音),我想将它们转换为 mp3。每个 .aup 都是黑胶唱片的整面(我不想分割音轨 - 整面作为一个 mp3 就可以了)。我的问题是如何一次性将所有这些 aup 批量转换为 mp3。一次打开一个 .aup,然后在“应用链”对话框中为 130 个文件选择“应用于当前项目”会非常繁琐。一个接一个。
有谁能成功修改代码或者找到解决方案吗?
我已经将其追溯到(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;
}
}
答案1
我决定在 autohotkey 中运行我自己的脚本(它有点不稳定,但可以一次处理几个文件):
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
答案2
如果您不具备 C++ 知识,这将会有些棘手,因为您需要了解对象mChains
实例化的类结构并调用正确的函数来链接它。
另一种方法是使用自动识别它为您模拟 GUI 点击。
答案3
Audacity(至少是最近的版本)在对话框中有File一个Apply Chain...按钮 Apply to Files... ,允许将链同时应用于多个文件。