Download Wavelength for Linux
This program is in the public domain.
Continuing my pursuit of minimalist software, I
bring you the ultimately trivial 'wavelength'.
Wavelength will attempt to open a wave file,
and upon determining that the header is somewhat
in good order, overwrite the data length entry
in the header with the actual data length found
to be in the file. This may or may not match
the number that is found in the header, and so
wavelength will perform no meaningful operation
on a correctly formatted wave file. It is
intended to be used to fix files that report
the length wrong in the header.
I made this utility because I like to use
command line record programs. The problem
is that one doesn't always know how long she
will be recording, and so the programs will just
continue recording until a ctrl-C. This
causes the program to be unable to update the
header with the amount of data recorded so far.
I could alter one of these programs to trap the
break signal and update the header on exit, but
this does not fix the case of recording to
stdout, and piping through other utilities such
as say, a command line vu meter. The record
program cannot seek on the pipe and so the
resultant file at the end of the pipe must remain
broken.
I have altered my record program to exit with
zero status on ctrl-C, and so I can put it in a
script like so:
record | vu > my_new.wav
wavelength my_new.wav
Then I can record to my heart's content, press
ctrl-C, and the script will stop recording and
proceed to the fixing of the header. Now other
applications can read the file without failing
or complaining.
Toby Shepard
toby@rcsreg.com