Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sivaraam/fft_chat

A Python chat application with Fast Fourier Transform used as intermediary format of conversion before transmission.
https://github.com/sivaraam/fft_chat

Last synced: 24 days ago
JSON representation

A Python chat application with Fast Fourier Transform used as intermediary format of conversion before transmission.

Awesome Lists containing this project

README

        

## FFT Chat
A GUI based chat room that applies uses FFT to encode/decode
messages sent by users. It is a client/server based application.

### Usage
* See if [Dependencies](#dependencies) have been installed.

* Start the server:

`python3 server.py`

By default, the server runs in port in port `33000`. Currently it can
only be changed by editing the source of `server.py`.
The `PORT` variable has to be changed.

* Start the client:

`python3 client.py`

The client asks for the `HOST` address and `PORT` to connect to. If
both client and server run in the same machine, no need to enter
the HOST. If server runs in port `33000` no need to enter it either.

* Then user can follow instructions in the GUI window that pops up.

### Dependencies
* `numpy` (for FFT)
* `tkinter` (for GUI)

#### Installing dependencies
* `numpy`

```
pip3 install numpy
```

* `tkinter`
For Ubuntu or Debian based distributions:
```
sudo apt install python3-tk
```

For other platforms refer to the [official Tk documentation](https://tkdocs.com/tutorial/install.html).

### Notes
* The maximum packet size is limited to `102400`. It's a limitation which has to be fixed. References:
- [socket.recv -- three ways to turn it into recvall (Python recipe)](https://code.activestate.com/recipes/408859/)
- [Python socket receive - incoming packets always have a different size](https://stackoverflow.com/q/1708835/5614968)
- [Socket Programming HOWTO](https://docs.python.org/3/howto/sockets.html)

### References
* [Discrete Fourier Transform (numpy.fft)](https://docs.scipy.org/doc/numpy/reference/routines.fft.html)
* [Let’s Write a Chat App in Python](https://medium.com/swlh/lets-write-a-chat-app-in-python-f6783a9ac170)
* [Object serialization in Python](https://www.thepythoncorner.com/2016/12/object-serialization-in-python/?doing_wp_cron=1551636082.3169770240783691406250)
* [pickle — Python object serialization](https://docs.python.org/2/library/pickle.html)
* [socket — Low-level networking interface](https://docs.python.org/3/library/socket.html)