-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwavNormalize.cmd
More file actions
31 lines (26 loc) · 758 Bytes
/
wavNormalize.cmd
File metadata and controls
31 lines (26 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
@echo off
echo ###################################################
echo # Description: Normalizes a wav file
echo # Usage: wavNormalize.cmd audio.wav [-3]
echo # Param 1: Audio file
echo # Param 2 [Optional]: dB to normalize to (0 is max volume)
echo # Requires: SoX
echo ###################################################
echo.
REM Check parameters
IF "%~1"=="" (
echo Error: 1st arg must be an audio file
exit /b 1
)
REM Set gain default
set "gain=0"
IF NOT "%~2"=="" set "gain=%~2"
echo [Optional]: Using gain of %gain%
REM Get filename
set "filename=%~1"
set "outputFile=%~n1.normalized%~x1"
echo Normalizing audio: %filename%
REM Do conversion
sox "%filename%" "%outputFile%" norm %gain%
REM Complete
echo Success: Normalized: %outputFile%