Welcome Guest ( Log In | Register )

SOX U-Law WAV to "Microsoft WAV"
Shane N
post Nov 12 2007, 19:27
Post #1

Group: Members
Posts: 7
Joined: 13-December 06
Member No.: 38638

I've got U-Law WAVs that I need to encode to the Microsoft WAV format.

When I run the following command, and open the file test.wav, it works fine:
sox.exe "ulawfile.wav" -t wav -r 16000 test.wav

However, I need to run this in a PHP site, and would like it to start the download immediately so the user doesn't have to wait for it to encode, so I run this:
sox.exe "ulawfile.wav" -t wav -r 16000 -

That command is executed and the results are dumped out immediately. However, when you try to play the file, it works fine, but you cannot "jump" ahead in the file. When you click on an area in the playback bar, it gives me an error "Windows Media Player cannot play the file." If I start it from the beginning and let it play by itself, it works fine, I just can't jump around in the playback.

What would cause this?

(Sorry if this isn't the right forum, I couldn't find one that dealt with WAVs directly)
Go to the top of the page
+Quote Post
Start new topic
post Nov 12 2007, 20:53
Post #2

Group: Members
Posts: 9
Joined: 31-October 05
Member No.: 25467

sox writes .wav files with the initial length set to zero, then when the input is finished it rewrites the header with the correct value. Since you're sending the output through a pipe it can't rewrite the header; it normally gives a warning like:

sox: Length in output .wav header will be wrong since can't seek to fix it

This could cause the problems you're seeing with skipping in the file, since whatever you're using to play it doesn't know how long it is.
Go to the top of the page
+Quote Post

Posts in this topic

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 20th April 2014 - 23:25