Page 1 of 1
sox WARN wav: Premature EOF on .wav
Posted: Sun Mar 20, 2011 5:25 am
by somenick
I'm exporting multiple wav files and using then running a sox script on them. Any idea what's happening? I attached a sample wav file.
Any help appreciated,
Thanks
Re: sox WARN wav: Premature EOF on .wav
Posted: Sun Mar 20, 2011 6:22 am
by kozikowski
I'm not sure what I'm supposed to be looking for. This seems to be a perfectly correct sound file. It's a mono show carried on left and right. It's 44100, 32-floating, Stereo.
Just for grins, you might try resetting Audacity to 44100, 16-bit, Stereo and make a new recording. You may have found an application that doesn't like 32-bit floating format.
Koz
Re: sox WARN wav: Premature EOF on .wav
Posted: Sun Mar 20, 2011 8:27 am
by somenick
Code: Select all
FOR %%f IN (*.wav) DO CALL :runsox "%%f"
GOTO :EOF
:runsox
soxi -D %1>tmpfile
SET /P decvalue=<tmpfile
calcoo %decvalue%*1.1>tmpfile
SET /P decvalue=<tmpfile
sox -n -c 2 -r 44100 silence.wav trim 0 %decvalue%
sox %1 silence.wav %1
sox %1 %1 repeat 6
Seems there's something wrong with the SOX script, no fault of audacity. Any idea what's wrong?
This line worked for ogg files, but the script fails here when I run it on wav files.
Or maybe I should raise this on the SOX mailing list.. cuz it's no fault of audacity.

Re: sox WARN wav: Premature EOF on .wav
Posted: Sun Mar 20, 2011 3:32 pm
by steve
I think the problem is that while writing the output, the input file (that is being overwritten) is still open, thus generating the error "Premature EOF on .wav input file".
If you output to a different file name (and then optionally delete the input file) then it should work.
Re: sox WARN wav: Premature EOF on .wav
Posted: Mon Mar 21, 2011 12:00 pm
by somenick
Thanks steve. Strange this exact script worked for ogg files :S. Outputing to temp a file first fixed the issue.
Re: sox WARN wav: Premature EOF on .wav
Posted: Mon Mar 21, 2011 7:19 pm
by steve
I'm guessing that SoX automatically makes a temporary copy when mixing compressed files.