{"id":30589219,"url":"https://github.com/arnavballincode/realtime_audiostream_cn","last_synced_at":"2025-08-29T15:21:21.181Z","repository":{"id":308894362,"uuid":"1034482604","full_name":"ArnavBallinCode/Realtime_Audiostream_CN","owner":"ArnavBallinCode","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-09T18:15:45.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-09T20:27:28.463Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArnavBallinCode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-08T13:11:24.000Z","updated_at":"2025-08-09T18:15:48.000Z","dependencies_parsed_at":"2025-08-09T20:27:53.926Z","dependency_job_id":null,"html_url":"https://github.com/ArnavBallinCode/Realtime_Audiostream_CN","commit_stats":null,"previous_names":["arnavballincode/cn_project","arnavballincode/realtime_audiostream_cn"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ArnavBallinCode/Realtime_Audiostream_CN","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArnavBallinCode%2FRealtime_Audiostream_CN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArnavBallinCode%2FRealtime_Audiostream_CN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArnavBallinCode%2FRealtime_Audiostream_CN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArnavBallinCode%2FRealtime_Audiostream_CN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArnavBallinCode","download_url":"https://codeload.github.com/ArnavBallinCode/Realtime_Audiostream_CN/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArnavBallinCode%2FRealtime_Audiostream_CN/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272709942,"owners_count":24980350,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-29T15:21:18.550Z","updated_at":"2025-08-29T15:21:21.174Z","avatar_url":"https://github.com/ArnavBallinCode.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Real-Time Voice Streaming over UDP\n\nThis project demonstrates real-time audio streaming from one computer (sender) to another (receiver) over a local network using Python, UDP sockets, and the sounddevice library.\n\n## How It Works\n\n### 1. Sender (`voice_sender.py`)\n- Captures audio from the microphone in small chunks (frames) using the sounddevice library.\n- Each chunk is converted to bytes and sent as a UDP packet to the receiver's IP address and port.\n- Uses UDP for low-latency, real-time transmission (no retransmission, no ordering, no connection setup).\n\n### 2. Receiver (`voice_receiver.py`)\n- Listens for incoming UDP packets on a specified port (default: 5005) on all network interfaces.\n- For each received packet, the audio data is extracted and played immediately using the sounddevice library.\n- If no packet is received within a short timeout, silence is played to avoid audio glitches.\n\n## Network Details\n- **Addressing:**\n  - The sender targets the receiver's IP address (e.g., `10.0.1.217`).\n  - The receiver binds to `0.0.0.0`, meaning it listens on all available network interfaces.\n- **Port:**\n  - Both sender and receiver use the same UDP port (default: 5005).\n- **Protocol:**\n  - UDP (User Datagram Protocol) is used for fast, connectionless communication.\n  - No guarantee of delivery, order, or duplication protection (ideal for real-time audio).\n\n## Audio Details\n- **Sample Rate:** 44100 Hz (CD quality)\n- **Channels:** Mono (1 channel)\n- **Chunk Size:** 1024 samples per packet\n- **Format:** 16-bit signed integers (`int16`)\n\n## How to Run\n1. **On the receiver (Windows):**\n   - Run `python voice_receiver.py`.\n2. **On the sender (Mac):**\n   - Set the correct `RECEIVER_IP` in `voice_sender.py` to the receiver's IP.\n   - Run `python voice_sender.py`.\n\n## What Happens Internally\n- The sender continuously captures and sends audio packets to the receiver.\n- The receiver's callback function fetches each UDP packet, converts it to audio, and plays it in real time.\n- If a packet is lost or delayed, the receiver fills the gap with silence (no blocking or waiting).\n- This setup is unicast (one-to-one), connectionless, and optimized for low-latency streaming.\n\n## Requirements\n- Python 3.x\n- `sounddevice` and `numpy` libraries (install via `pip install sounddevice numpy`)\n- Both devices must be on the same local network and have UDP port 5005 open (check firewall settings).\n\n---\n\nThis project is a simple example of real-time audio streaming and can be extended for more advanced use cases (e.g., multi-user, encryption, error correction, etc.).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farnavballincode%2Frealtime_audiostream_cn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farnavballincode%2Frealtime_audiostream_cn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farnavballincode%2Frealtime_audiostream_cn/lists"}