1 year ago

#379098

test-img

jayphc

I'm running into an encoding error trying to use SoX with Powershell

This is the error I'm running into:

C:\Program Files (x86)\sox-14-4-2\sox.exe FAIL sox: --encoding: `ncodedCommand' is not one of: signed-integer, unsigned-integer, floating-point, ms-adpcm, ima-adpcm, oki-adpcm, gsm-full-rate, u-law, mu-law, a-law.

I've doublechecked the encoding for the wav files and they're correct full resolution wavs (44.1k). It worked before with a similar bash shell script.

This is the code I'm using. It's modified from a bash shell script that was used for the same process - to append a wav file to a bunch of other wavs.

#Directory for the files that will be looped through and appended
$headerFileDirectory = "C:\Users\name\Desktop\HLDCM030822-uLaw-1-030922\1 wavs"
#Directory for the file to appened the header files with
$appendFileDirectory = "C:\Users\name\Desktop\HLDCM030822-uLaw-1-030922\appendfile"
#Output directory for the combined files to live.
$outputDirectory = "C:\Users\name\Desktop\HLDCM030822-uLaw-1-030922\2 appended wavs"

# Gets the header files
$headers = Get-ChildItem -Path $headerFileDirectory -Filter "*.wav"

# Gets the append file
$appendFile = Get-ChildItem -Path $appendFileDirectory -Filter "append.wav"

# Loop through each header file, and append them with the append file, outputs new files to the output directory.

foreach ($i in $headers)
{
    sox $i $appendFile {$i}out.wav
}

powershell

sox

0 Answers

Your Answer

Accepted video resources