| @echo off | | chcp 65001 >nul | | | | | | set m=1.5 | | for /f "delims=" %%i in ('dir /b /a-d *.mp3') do ( | | set file=%%i | | setlocal enabledelayedexpansion | | for /f "tokens=1-2 delims==" %%a in ('ffprobe -loglevel 0 -show_streams "!file!"') do ( | | if "%%a" equ "sample_rate" ( | | set sr=%%b | | ) else if "%%a" equ "channel_layout" ( | | set cl=%%b | | ) else if "%%a" equ "duration" ( | | for /f "delims=" %%e in ('powershell -c %%b*%m%') do set dt=%%e | | ) | | ) | | ffmpeg -f lavfi -t !dt! -i anullsrc=channel_layout=!cl!:sample_rate=!sr! -i "!file!" -filter_complex "[1:a][0:a]concat=n=2:v=0:a=1" outputx.mp3 | | move /y outputx.mp3 "!file!" | | endlocal | | ) | | pauseCOPY |
每次使用前先备份! |