Created
April 21, 2023 13:44
-
-
Save Silenoid/f796d0148a0ef89b4b1360a97aa544fe to your computer and use it in GitHub Desktop.
A Powershell script to normalize audio in bulk using SoX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Loop through each .wav file in the current directory | |
$inputFiles = Get-ChildItem -Path . -Filter *.wav | |
$inputFiles | ForEach-Object -Parallel { | |
$newFilename = $_.BaseName + ".wav" | |
Write-Output ("Processing $newFilename") | |
$outputFile = Join-Path $_.DirectoryName "converted" $newFilename | |
# If the "converted" directory doesn't exists, create it | |
if (!(Test-Path "converted")) { | |
New-Item -ItemType Directory -Path "converted" | |
} | |
# interesting effects | |
# compand 0.3,1 6:-70,-60,-20 -1 0 0.2 | |
& sox --norm=+8 $_.FullName $outputFile pitch -80 bass +8 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment