0

当我运行脚本并且我的“输入”文件夹中有一个 .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

有谁知道我做错了什么?我是这方面的初学者。

4

1 回答 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行。(请不要在这些目录上留下尾随路径分隔符)。然后,我建议您在测试目录中尝试该脚本,并针对一些复制的文件,然后在您的生产环境中尝试它。35input.wem

于 2020-04-25T13:41:50.053 回答