Due date: March 13th
by 11:59pmAn audioconference, or internet phone, 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 World-Wide Web has fueled interest in the Internet and in it, interest in Internet telephony.
For this project, you are to write a basic two-person audioconference, 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 would like.
Speak must run on either Microsoft Windows or Linux. You will have to get it working on two machines, actually.
Speak will use standard Internet sockets to make connections between the audioconference 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 audioconferences sample 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 test this in project 2b).
Speak can enable basic speech detection if indicated 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.
Thus, you can detect speech based on energy levels only. You can tune
your speech detection threshold to work well in your environment. See
computeEnergy.c
and
getThresh.c
for one such
example.
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. (You will test this in project 2b.)
There are many different architectural solutions you can have for your Speak.
Basic speech detection using energy level only: computeEnergy.c
and getThresh.c
You may do your implementation in Linux or Windows. 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
You may do your implementation in Linux or Windows. 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:
Tar up (with gzip) your files, for example:
mkdir proj2 cp * proj2 /* copy all your files to submit to proj2 directory */ tar -czf proj2.tgz proj2
then attach proj2.tgz to an email with "cs525_proj2" as the subject.
You must turn in all source code used in your project, including header files. Please include the project files required for building your code. Have a README file with any special instructions or platform requirements for running your application.
Please include a file named "group.txt" which contains the following:
login_name1 last_name1, first_name1 login_name2 last_name2, first_name2
You will use the online turnin program
(/cs/bin/turnin
) to submit your files:
Package up (with pkzip) your files, for example:
mkdir proj2 copy * proj2 /* copy all your files to submit to proj2 directory */ pkzip proj2.zip proj2
Copy the proj2.zip
to your account on
the ccc machines.
Run:
/cs/bin/turnin submit cs525z proj2 proj2.zip
to submit your files.
Return to the Multimedia Networking Home Page
Send all project questions to the TA mailing list: cs525z_ta@cs.wpi.edu.