sox WARN wav: Premature EOF on .wav

This section is now closed.
Forum rules
Audacity 1.3.x is now obsolete. Please use the current Audacity 2.1.x version.

The final version of Audacity for Windows 98/ME is the legacy 2.0.0 version.
Locked
somenick
Posts: 19
Joined: Thu Feb 17, 2011 8:21 am
Operating System: Please select

sox WARN wav: Premature EOF on .wav

Post by somenick » Sun Mar 20, 2011 5:25 am

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
Attachments
2.wav
(696.02 KiB) Downloaded 164 times

kozikowski
Forum Staff
Posts: 68902
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: sox WARN wav: Premature EOF on .wav

Post by kozikowski » Sun Mar 20, 2011 6:22 am

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

somenick
Posts: 19
Joined: Thu Feb 17, 2011 8:21 am
Operating System: Please select

Re: sox WARN wav: Premature EOF on .wav

Post by somenick » Sun Mar 20, 2011 8:27 am

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.

Code: Select all

sox %1 silence.wav %1

Or maybe I should raise this on the SOX mailing list.. cuz it's no fault of audacity. :oops: :oops:

steve
Site Admin
Posts: 80679
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: sox WARN wav: Premature EOF on .wav

Post by steve » Sun Mar 20, 2011 3:32 pm

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.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

somenick
Posts: 19
Joined: Thu Feb 17, 2011 8:21 am
Operating System: Please select

Re: sox WARN wav: Premature EOF on .wav

Post by somenick » Mon Mar 21, 2011 12:00 pm

Thanks steve. Strange this exact script worked for ogg files :S. Outputing to temp a file first fixed the issue.

steve
Site Admin
Posts: 80679
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: sox WARN wav: Premature EOF on .wav

Post by steve » Mon Mar 21, 2011 7:19 pm

I'm guessing that SoX automatically makes a temporary copy when mixing compressed files.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Locked