A simple voice communicator in python
A simple voice communicator in python for a studies project created in teams of two
The intentional way of installing dependencies is running pip install -r requirements.txt
command. However installation of PyAudio on Windows systems might result in error. If it does, then download appropriate binary file form here. For example if you have python 3.9.1 64-bit version you want to download PyAudio‑0.2.11‑cp39‑cp39‑win_amd64.whl
file.
It is highly recomended to use virtual enviroment
Server can be run by executing command
python Server/run.py <port>
where the port variable is optional and default port is 9999
. Port also can be set using enviroment variable named PORT
. Server runs on all interfaces.
Client UI can be run from the realsed package from here or using the python command
python Client/client.py
The server and client communicates using both TCP and UDP sockets where TCP is used as control to the connection, the UDP is used as voice delivery. Both apps share the same package wraping utility tool. TCP packages contain json values.
By default to be allowed for proper communication some values must me established in a simple exchange:
All presented packages contain KEY
value which is used as a number describing package name.
Package Name | Required Values | Optional values | JSON Example |
---|---|---|---|
ACK |
| ||
UNKNOWN_ERROR |
| ||
SEND_NICKNAME | NAME |
| |
SEND_NEW_USERS | USERS |
| |
DISCONNECT | REASON |
| |
SERVER_CLOSE |
| ||
SESSION | SESSION |
| |
CLIENT_PORT | PORT |
| |