[英]How do I set an output folder for my .wem converter?
當我運行腳本並且我的“輸入”文件夾中有一個 .wem 文件時,我試圖做到這一點,它會直接將其轉換為我的“輸出”文件夾。 但我似乎無法弄清楚這一點。
@Echo off
Echo -------------------------------------------------------------------------------------
For %%f in ("%~dp0input\*.wem") do "./ww2ogg024/ww2ogg.exe" --pcb "./ww2ogg024/packed_codebooks_aoTuV_603.bin" "%%f"
For %%f in ("%~dp0outnput\*.ogg") do revorb.exe "%%f"
Echo -------------------------------------------------------------------------------------
pause
有誰知道我做錯了什么? 我是這方面的初學者。
我不知道您的可執行文件,但是,快速搜索顯示了它們的命令行選項:
ww2ogg input.wav [-o output.ogg] [--inline-codebooks] [--full-setup] [--pcb packed_codebooks.bin]
revorb <input.ogg> [output.ogg]
根據該信息,我建議您嘗試這種方法, ( Rem
包括解釋) :
@Echo Off
Rem Define the location for ww2ogg.exe.
Set "WemToOggPath=C:\SomeLocation\ww2ogg024"
Rem Define the location for revorb.exe.
Set "MyRevorbPath=C:\SomeLocation"
Rem Exit if the required executables and input files are not available.
If Not Exist "%WemToOggPath%\ww2ogg.exe" Exit /B 1
If Not Exist "%MyRevorbPath%\revorb.exe" Exit /B 1
If Not Exist "%~dp0input\*.wem" Exit /B 1
Rem Create output directory if it does not already exist along side this script.
If Not Exist "%~dp0output\" MD "%~dp0output"
Echo -------------------------------------------------------------------------------------
Rem Loop through each .wem file located inside the a directory named input along side this script.
For %%I In ("%~dp0input\*.wem") Do (
Rem Run ww2ogg.exe against each .wem file outputting them to the same directory but with an .ogg extension.
"%WemToOggPath%\ww2ogg.exe" "%%I" -o "%%~dpnI.ogg" --pcb "%WemToOggPath%\packed_codebooks_aoTuV_603.bin"
Rem If the last ww2ogg.exe process was successful then.
If Not ErrorLevel 1 If Exist "%%~dpnI.ogg" (
Rem If there is still a .wem file delete it.
If Exist "%%I" Del "%%I"
Rem Run revorb.exe against the .ogg file outputting it to the output directory along side this script.
"%MyRevorbPath%\revorb.exe" "%%~dpnI.ogg" "%~dp0output\%%~nI.ogg"
Rem If the last revorb.exe process was successful and there is still a matching .ogg file inside the input directory delete it.
If Not ErrorLevel 1 If Exist "%%~dpnI.ogg" If Exist "%~dp0output\%%~nI.ogg" Del "%%~dpnI.ogg"
)
)
Echo -------------------------------------------------------------------------------------
Pause
由於我不了解這些實用程序,因此我試圖假設什么,因此如果您的轉換過程沒有留下未轉換的文件,則腳本可能會更小。
請通讀備注以准確了解它的作用,然后再運行它,最重要的是,確保將第3
行和5
行的Rem
C:\SomeLocation
修改為包含兩個可執行文件的那些。 (請不要在這些目錄上留下尾隨路徑分隔符) 。 然后,我建議您在測試input
目錄中嘗試該腳本,並針對一些復制.wem
文件,然后在您的生產環境中嘗試它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.