Files
V2_micropython/websocket_server/README.md
jeremygan2021 e0776a1839 t
2026-03-02 22:43:04 +08:00

32 lines
773 B
Markdown

# WebSocket Audio Server
This is a FastAPI server that receives audio from an ESP32 via WebSocket, saves it, processes it (converts 32-bit to 16-bit), and sends it back for playback.
## Installation
1. Install dependencies:
```bash
pip install -r requirements.txt
```
## Usage
1. Start the server:
```bash
python server.py
```
Or:
```bash
uvicorn server:app --host 0.0.0.0 --port 8000
```
2. Update the IP address in `main.py` on your ESP32 to match your computer's IP address.
Look for `SERVER_IP` variable.
## Features
- Receives raw audio stream from ESP32.
- Saves raw audio to `received_audio.raw`.
- Converts 32-bit audio (from ICS-43434) to 16-bit audio (for MAX98357A).
- Streams processed audio back to ESP32 for playback.