next up previous
Next: Converting to .WAV Up: Getting it to work Previous: The Easy Way (No

The ``Home-brew'' Streaming Player

The previous method works, but it requires the whole file be downloaded before playback. It's okay if you either have enough bandwidth to download quickly, or that you are patient enough to download via a slower connection.

With a little bit of virtual elbow grease, you can ``stream'' the voice file over a slower connection so you don't have to save the whole file first. To do this, you'll need to know more about using the command line interface of Windows.

First, download and unzip the package from http://curl.haxx.se/latest.cgi?curl=win32-nossl. This package contains an executable file (along with some other documents) called curl.exe. This is a cool command line program that downloads stuff from the internet.

Before we use curl in conjunction with speexdec, let's talk about getting Windows to find these executable files. If you know how to set the PATH environment variable, just make sure it includes the paths to the folders containing curl.exe and speexdec.exe. If you don't want to mess with PATH, a quick-and-dirty method is to unzip the Speex and curl packages to the Windows folder. This folder is usually c:\windows for Windows 95/98/me and c:\winnt for Windows NT/2000/XP. The danger is that you may overwrite existing files called curl.exe and speexdec.exe. I have yet to find one Windows installation with these filenames.

Once you know Windows knows how to find curl.exe and speexdec.exe, we can begin the fun. Let's take the file at http://www.drtak.org/teaches/ARC/cisp317/0821.spx. Instead of saving the file, copy the link to the clipboard. Then open a command line interface and type in the following (rather long) command:

curl -m 7200 http://www.drtak.org/teaches/ARC/cisp317/0821.spx | speexdec -

You can click on the upper-left icon in a command line interface and use ``paste'' to paste in the URL to save some typing.

This home brew streaming method works, but it does not guarantee a minimum buffer size. In other words, if your network connection is slow, you may encounter some choppy playback. In most systems, the built-in buffer size of a pipe is sufficient to ensure a relatively smooth playback as long as you have enough average bandwidth.


next up previous
Next: Converting to .WAV Up: Getting it to work Previous: The Easy Way (No
Tak Auyeung 2004-01-30