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:
- The first four ASCII characters in a working WAV file are RIFF: cpfaq.blogspot.com
- PowerShell Get-Content: technet.microsoft.com
- PowerShell array notation: technet.microsoft.com
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 $c
if ($c -eq "R" )
{write-host "File OK"}
else
{write-host "File Broke"}
else
{write-host "File Broke"}