voicechat - Voice chat via TCP/IP
Version 0.40 beta (October 29th, 1995)
Documentation (README)

Copyright 1995 Riku Saikkonen (rjs@spider.compart.fi)

This program is free software; you can redistribute and/or modify it
under the terms of the GNU General Public License version 2 as published
by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.

You should have received a copy of the GNU General Public License along
with this program (as the file COPYING); if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

The author, Riku Saikkonen, can be contacted via the following means:
E-mail (preferred): rjs@spider.compart.fi, and maybe rjs@isil.lloke.dna.fi
Paper mail: Riku Saikkonen
            Alakartanontie 4 B 63
            SF-02360  ESPOO
            Finland


This is supposed to be documentation. :) I'll write some better
documentation and a protocol description later.

Voicechat is in its beta stages: expect future versions not to work with
this one, and don't assume the program will always do something it does
now... Especially the protocol will most likely change.


Requirements:
 - a reasonably fast Linux system (for now) with a Linux-supported sound
   card (a 486-33 should do, maybe slower ones too) and a microphone
   connected to it
 - a working network connection to another system running voicechat
   (obviously)
 - the GSM library (libgsm), gsm-1.0.tar.gz, search for it where you found
   voicechat or somewhere else :)


Installation

1. Untar the thing somewhere, and read this README. :)
2. Get the gsm library from somewhere and compile it.
3. Edit config.h, set the sound devices and options. Don't worry about
   DEF_SILENCELIMIT yet. The default options should be good for a normal
   Linux setup.
4. Edit the Makefile, at least set the location of the GSM library and
   include file...
5. `make voicevolume'
6. Run voicevolume and get a silence limit from it (instructions below).
7. Edit config.h again and set DEF_SILENCELIMIT to the limit you got in step
   6.
8. `make'
9. Now you should have a binary called `voicechat'. If not, e-mail me and
   tell me where you had problems.


Using voicevolume

Voicevolume is a simple program that reads (records) from your audio device
to memory, and displays a quick estimate of the volume of the sound. The
scale of the number is 0 (completely silent) to about 65400 (probably too
loud).

It is needed for getting a `silence limit' (which depends on your
microphone, mixer settings, and the general amount of noise in your house)
for voicechat. The silence limit is simply a volume under which no sound
data (only an indication of silence) is transmitted through the network.
Thus, sound under that volume won't be heard at the other end (unless
there's a louder sound heard at the same time).

This is there to save network bandwidth when you're recording data but not
speaking (and between words). Thus, if there's only a local Ethernet
connection (or similar fast connection) between the machines where you use
voicechat, you can set the limit to 0 and voicechat will work. (But setting
it to a higher number won't hurt, and it will save the bandwidth of a fast
connection too...)

How do you get a good limit, then? Well, first run voicevolume (it's good to
have a mixer program running where you can easily access it (an X window,
maybe) too; if you have a mixer, that is). Then, get out your microphone,
turn it on, and move it to the place where you usually keep it when you
speak to it (near your mouth, probably...). Set your mixer to record from
the microphone.

Say something to it in a normal voice, just to see if it works. The volume
displayed by voicevolume should increase by a noticeable amount (ignore the
`(silent)' displayed after low volumes). If not, check the microphone
connections, audio device, and mixer settings.

Now you should first tune your mixer volume. The best volume (giving the
best sound quality) would be one that displays volumes of at most about
55000 when you're speaking loudly. Much lower ones work well too, as long as
the difference between silence and you speaking is noticeable.

Next, getting a working silence limit... Be silent for a while, and look at
what the displayed volume is. A good silence limit is somewhat above the
maximum volumes shown when you aren't speaking and your surroundings are
their normal volume (i.e. no one is breaking a nearby window or shouting in
your ear :)). For example, if you see volumes from 0 to about 2000, a good
silence limit would be 2500 or 3000.

The higher the limit is (and thus the more amount of silence that voicechat
finds), the better for network bandwidth. But if it's too high, you speaking
quietly may not be heard from the other end.

You can change the limit later by changing DEF_SILENCELIMIT in config.h, and
recompiling voicechat (and voicevolume).


Using voicechat

To the point, finally. :)

Starting it: The command line syntax is `voicechat site port', where site is
the site you want to connect to or `-' if you want to listen for connections
from others, and port is the port you want to use. Any port over 1024 should
work as long as it's not in use at the time.

The way to establish the connection is to run `voicechat - port' on one
end and `voicechat site port' on the other, where the ports are the same
(that port is used on the listening machine, and should be the same in both
commands), and `site' is the hostname (or IP address) of the other,
listening site.

After you're connected, you should see the rather plain main display of
voicechat. Currently two windows whose edges aren't shown :), and two status
lines at the bottom. Now the other end should see what you type and vice
versa (just like normal talk or ntalk). Try it...

Then, the real test... Get your microphone ready, press Ctrl-A (a Rec
indicator should appear on your status line), say something to the
microphone, and press Ctrl-A again (the Rec indicator should disappear). The
other end should have heard that. Ask the other end to do the same, and see
if it works in that direction too.

If those work, congratulations. :)

If there are parts missing from the speech, the recording end's silence
limit is probably wrong, or the recording machine is too slow.


Now for the special keys you need in voicechat:

Ctrl-A  Starts or stops recording.

Ctrl-X  Quits voicechat.

And a few ones you probably won't need:

Ctrl-P  While recording, sends a pause mark to the other end; if the network
        connection is too slow to send data in real time, the sound will be
        paused for a while here (and in any piece of silence, but that's
        automatic).

Ctrl-F  Flush the sound output buffer. I.e. play anything you've received
        from the other end independent of the pause or silence marks.

Ctrl-T  Send a `test request'. This works rather like `ping', i.e. the other
        end replies to it if it's working properly.


Well, there it was. If you have questions, e-mail me... Even if you don't,
e-mail me telling that voicechat works for you. :)

I know, there are a lot of things to improve. Some marked with `XXX' in the
source. Some in the TODO file. Some only in my head. :)

To know about future versions, finger or e-mail me (rjs@spider.compart.fi or
maybe rjs@isil.lloke.dna.fi (might not always work)).

Riku Saikkonen
rjs@spider.compart.fi
