Due date: October 21st
by 11:59pmAn audioconference, or Voice over IP (VoIP) application, allows people to talk to each other from computers connected across a network. Although networked computers have been able to do audio well for over 10 years, the explosive growth of the Web and other aspects of the Internet has fueled interest in VoIP.
For this project, you are to write a basic two-person VoIP application named Speak and explore how some basic system parameters effect the quality of the audio stream. Speak will incorporate speech detection, directly from your project 1, to avoid sending unnecessary silent packets onto the network.
Speak can have a minimal user interface, but needs to support some command line parameters (or basic menu interface) to allow varying of system parameters. You are free to add any additional features, as you see fit.
You can develop Speak on pretty much any OS: Windows, Mac or Linux. You will have to get it working on two machines, actually.
Speak will use standard Internet sockets to make connections between the VoIP processes. From any Internet host, a user running Speak should be able to connect to another user running Speak from any other Internet host, so you need a way to specify the hosts at run-time. You may wish to make the port numbers to which they connect dynamic, too, but that is optional.
Speak needs to support both TCP and UDP sockets. You can have a default connection type, but there should be a way the user can specify the socket type when Speak starts.
Speak should support a variety of samples intervals. Typical VoIP clients take chunks of audio from the audio device every 20, 40 or 60 ms in order to keep latency low. You may choose one of these for the default, but must then provide a means to specify alternate sample sizes (up to a second) when Speak starts. Running Speak at larger sample intervals will give you some insight in how latency makes interactive communication difficult (you will evaluate this effect in project 2b).
Speak can enable basic speech detection, if indicated by the user, at run-time. Since the size of your speech chunks will likely be much smaller than the sample interval you used in project 1, searching backward (or forward) for a zero-level crossing rate for 250ms is not practical (or is computing Energy over the entire speech sample). Thus, you can detect speech based on Energy levels only for the sound chunk sampled. You can tune your speech detection threshold to work well in your environment.
In order to evaluate how Internet packet loss affects audio, Speak must be able to randomly drop packets it receives. Loss should be done on a packet level and at various rates when Speak starts (again, you will evaluate this in project 2b).
There are many different architectural solutions you can have for your implementation of Speak.
This sub-section has some Windows-specific hints.
Here is some sample code showing system calls that you may find helpful. Some must be used while others may be used depending upon your implementation:
A simple header file to generate error messages for Winsock
errors: sockerr.h
Basic TCP sockets: tcp-talk.cpp
, tcp-listen.cpp
Basic UDP sockets: udp-talk.cpp
, udp-listen.cpp
Get the IP address of a host:
getIPaddress.cpp
This sub-section has some Linux-specific hints.
Here is some sample code showing system calls that you may find helpful. Some must be used while others may be used depending upon your implementation:
Basic TCP sockets: talk-tcp.c
, listen-tcp.c
Basic UDP sockets: talk-udp.c
, listen-udp.c
Setting a timer: setitimer.c
Using POSIX threads: add2.c
-
add and subtract to an variable protected by a mutex (compile
with -lpthread
)
Allowing multiple interrupts: select.c
Parsing command line parameters: get-opt.c
Use the man
command to find out additional information
on the system calls used.
You must turn in:
You will use email to turn in your files. When ready, create a directory of your project based on your last name (i.e. claypool) and tar up (with gzip or winzip) your files, for example:
mkdir claypool cp * claypool // copy all your files to submit to the claypool dir tar czvf claypool.tgz claypool
then attach claypool.tgz to an email with "cs529-proj2" as the subject.
Return to the Multimedia Networking Home Page
Send all questions to the Mark Claypool.