我如何为我的.wem转换器设置一个输出文件夹?

问题描述 投票:0回答:1

我想让我运行脚本时,当我的 "输入 "文件夹中有一个.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

有人知道我做错了什么吗?我算是一个初学者了。

batch-file converters ripping
1个回答
0
投票

我对你的可执行文件一无所知,不过,快速搜索后发现了它们的命令行选项。

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

由于我不了解这些实用程序,我试图不作任何假设,因此,如果你的转换过程没有留下未转换的文件,脚本可能会变得更小。

请仔细阅读 Remarks,了解它的具体作用,然后再运行它,最重要的是,确保你修改了 C:\SomeLocation 在行 35 到存放两个可执行文件的目录。(请不要在这些目录上留下尾部的路径分隔符). 然后,我建议你在一个测试中尝试使用脚本 input 目录,并针对一些复制的 .wem 文件,然后再在生产环境中进行尝试。

© www.soinside.com 2019 - 2024. All rights reserved.