public inbox for speakup@linux-speakup.org
 help / color / mirror / Atom feed
* wave file editor to play with
@  Charles Hallenbeck
   ` Kirk Reiser
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Charles Hallenbeck @  UTC (permalink / raw)
  To: Speakup Distribution List

Hi people -

If anyone would like to play with a wave file editor I have written, you
are welcome to download it from:

http://www.mhonline.net/~chuckh/afix-0.01.tgz

I call it "afix" (audio fixer) and perhaps there is enough information in
the README and in the program's help screens to get started. Basically it
reads and writes .wav files, and lets you do tricks with the data while it
is in memory - splitting and joining tracks, adjusting the gain, trimming
out soft passages or loud passages (usually silences or clicks), adding
silent markers between tracks that are preserved when the files are
written and reread, copying, dropping, playing, and saving segments or the
whole file, etcetera etcetera. If your system is equipped with lame it can
also save wave files conveniently as mp3 files. If it is equipped with
mpg123 you can conveniently read mp3 files as wave files. If you have the
combination of trplayer and vsound you can read realmedia files as wave
files as well. Of course you can use lame, mpg123, and trplayer/vsound
without afix to do the same thing, but afix hides the interface and
integrates their use within the context of a wave file editor. The program
also relies on sox and the sox play script for converting some peculiar
wave files and playing samples. Of course it uses a command line interface
and is speech friendly, and it runs on modest systems - my system is so
modest it is practically bashful!!! 16 megs ram, 133 MHz 5x86, Slackware
4.0.

The tgz package is the source package and there are instructions for
compiling and installing. Feedback is appreciated. I have a zillion other
features I want to add, but there is enough here of interest to share with
others who might be interested. Feedback is welcome. Especially about
"segmentation faults" which I believe I have exterminated. (famous last
words!)

Chuck.


My web site is http://www.mhonline.net/~chuckh 
Q:	How does a single woman in New York get rid of cockroaches?
A:	She asks them for a commitment.



^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: wave file editor to play with
@  Charles Hallenbeck
  0 siblings, 0 replies; 5+ messages in thread
From: Charles Hallenbeck @  UTC (permalink / raw)
  To: speakup; +Cc: gshang10

Hi Geoff -

The "#x" and "#y" are meant to suggest just any old arbitrary numbers,
although the '#' is required. For instance, to copy track #1 to just after
track #5 you would enter "copy #1 #5". If you omit the destination number
then the track is duplicated right next to itself. If you then join them,
you have the original track concatenated with itself.

I guess it needs more of a manual... I promise it will be coming. I need to
also define a "gap" which is what separates one track from another. A gap
can be automatically detected if you wish (that is the default) and consists
of a 100 ms period of identical successive values. That many successive
identical values will produce no sound, no matter what the values are, and
in all likelihood they are zeros (or might as well be). How many samples
that is will depend on the sampling rate, sample size, number of channels,
etc., but 100 ms is the basic unit for a "gap" with this package.

You may find that a wav file only has one track - no gaps - that will
usually be the case. But you can split that trick in two with the command
"split #1" in which case it is split in two equal parts. the second argument
to "split" is a percent, with the percent sign first (for parsing
convenience) so if you want to split off just the first %10 of a long track
forspecial consideration, it would be "split #1 %10". Now you have two
tracks, but no gap has yet been placed between them. To place a gap of zeros
after the first of these two tracks, the command is "zero #1". Saving these
two tracks with their intgervening gap will produce a file which when you
next read it, will remember how many tracks you created in it. deleting (or
"drop"ping) the gap will cause the two tracks to be concatenated when
written to a file, so you will not later know anything about the division.

The "play" command also takes a track specifyer, such as "play #1" or "play
#3" except that now you have two more possibilities. You can say "play *"
and hear all the tracks, gaps and all, or you can specify a number of
different tracks in any order and hear them that way, as in "play #1 #5 #3
#9"

The "plot" command is perhaps the least obvious. It will show you four
different statistics calculated for each eighth of a track's duration. The
four statistics are "min" and "max" (obvious I hope), "drift" and "swing".
The "drift" is simply the ordinary mean of all the sample values. It ought
to be zero (or 128 for unsigned bytes) but may have "drifted" away from
zero, producing a DC component to the signal. The "swing" is the standard
deviation (engineers call it a "root mean square") and is a better index of
loudness than the min/max values. Each of these four statistics is shown for
eight equal divisions of the track's duration, so you can see how the values
progress across the track. I have played with this a lot and find that eight
is as many divisions as I can easily grasp at a time. You can always "split"
the track and repeat the "plot" on a smaller region, essentially zooming in
on it.

As for the -e switch, I think you are absolutely right - and I will get rid
of that as soon as I get a decent computer to use again! One thing I did not
mention is that when you use -m or -w to automatically process a file (as
opposed to editing it) it applies the "gain" command to bring the min and
max values as close to the limits of the sample size as possible without
clipping.

Sorry for the incomplete documentation, but thank goodness I put it out
there when I did, or it would now be a goner, I'm afraid!!!

Hope some of this helps... Chuck.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~ UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
 wave file editor to play with Charles Hallenbeck
 ` Kirk Reiser
 ` Geoff Shang
 ` Unix Sys Admin Job Opportunity (LONG) Janina Sajka
 wave file editor to play with Charles Hallenbeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).