March 27, 2013

Detect corrupt WAV files with Powershell

 If you need to check .wav files for corruption, here's a way to accomplish that with PowerShell.  Here's a few things to know:
This script checks the first character of the wav file header.:
 
$c = (Get-Content -Path C:\example.wav -Encoding Ascii -TotalCount 1)[0]
Write-Host $c
if ($c -eq "R" )
    {write-host "File OK"}
else
    {write-host "File Broke"}