SourceFiles.org - Use the Source, Luke
Home | Register | News | Forums | Guide | MyLinks | Bookmark

Related Sites

Latest News
  General News
  Reviews
  Press Releases
  Software
  Hardware
  Security
  Tutorials
  Off Topic


Back to files

voicechat - Voice chat via TCP/IP
Version 0.45 (January 4th, 1996)
Documentation (README)

Copyright 1995-1996 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, 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 still 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 Unix system with a sound device that can record and play (voicechat is known to work on Linux, UnixWare, and a few Suns, at least); of PCs, you need a supported sound card, and the machine should be something near a 486-25 or faster; and a microphone, of course
  • a working network connection to another system running voicechat (obviously)
  • the GSM library (libgsm), gsm-1.0.tar.gz or a newer version, search for it where you found voicechat or somewhere else :); some URLs for it: ftp://sunsite.unc.edu/pub/Linux/utils/compress/gsm-1.0.tar.gz ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/gsm-1.0.7.tar.gz

Installation

  1. Untar the thing somewhere, and read this README. :)
  2. Get the gsm library from somewhere and compile it. For Intel x86 systems, compile it with -DSASR and without either of -DUSE_FLOAT_MULS and -DFAST.
  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. That binary is the only thing (besides the normal system libraries) voicechat needs to run.

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 your soundcard has 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...). If your mixer has a `record source' option (this depends on the sound card type), set it 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 (see netstat -an).

The way to establish the connection is to run `voicechat - port' on one end (this first) and then `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 (they're mostly for debugging):

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.

Troubleshooting

Q1. I get a floating point exception whenever I record sound! A1. Check the compilation options of the GSM library. Intel x86 systems may

generate this error if you compile the GSM library with -DUSE_FLOAT_MULS or -DFAST.

Qn. Voicechat doesn't work! (:))

An. Some things you can do to try to find the culprit:

  1. Check if you can record properly:
    1. cat /dev/audio >testfile
    2. Say something to your microphone.
    3. Ctrl-C.
    4. cat testfile >/dev/audio
    5. You should hear what you just said. If this fails, check your soundcard's mixer settings (if any), whether the microphone works, and whether it's connected to your sound card :).
  2. Check the gsm library:
    1. cat /dev/audio | toast >testfile (toast is compiled in the bin directory of the gsm library)
    2. Say something...
    3. Ctrl-C.
    4. cat testfile | untoast >/dev/audio If this fails, there's something wrong with your compilation of the gsm library.
  3. Check your network connection. Maybe ftp something big (a few hundred K) to the other site, or send big ping packets (see the ping man page).

Well, there it was. If you have questions, e-mail me...

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 rjs@isil.lloke.dna.fi).

Riku Saikkonen
rjs@spider.compart.fi


Other Sites

Discussion Groups
  Beginners
  Distributions
  Networking / Security
  Software
  PDAs

About | FAQ | Privacy | Awards | Contact
Comments to the webmaster are welcome.
Copyright 2006 Sourcefiles.org All rights reserved.