{"id":29091237,"url":"https://github.com/theweird-kid/echo-link","last_synced_at":"2025-06-28T06:06:21.304Z","repository":{"id":300775213,"uuid":"1001450973","full_name":"theweird-kid/echo-link","owner":"theweird-kid","description":"udp based peer to peer voice chat application","archived":false,"fork":false,"pushed_at":"2025-06-23T14:32:55.000Z","size":4090,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-23T15:24:38.911Z","etag":null,"topics":["asio","cpp17","multithreading","opus-codec","portaudio","udp"],"latest_commit_sha":null,"homepage":"","language":"C++","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/theweird-kid.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-06-13T12:01:39.000Z","updated_at":"2025-06-23T14:32:59.000Z","dependencies_parsed_at":"2025-06-23T15:36:58.801Z","dependency_job_id":null,"html_url":"https://github.com/theweird-kid/echo-link","commit_stats":null,"previous_names":["theweird-kid/echo-link"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/theweird-kid/echo-link","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theweird-kid%2Fecho-link","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theweird-kid%2Fecho-link/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theweird-kid%2Fecho-link/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theweird-kid%2Fecho-link/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theweird-kid","download_url":"https://codeload.github.com/theweird-kid/echo-link/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theweird-kid%2Fecho-link/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262382743,"owners_count":23302297,"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","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":["asio","cpp17","multithreading","opus-codec","portaudio","udp"],"created_at":"2025-06-28T06:06:18.397Z","updated_at":"2025-06-28T06:06:21.295Z","avatar_url":"https://github.com/theweird-kid.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"echo-link/README.md\n# Echo-Link\n\n![EchoLink High-Level Diagram](Echolink.png)\n\n## Overview\n\n**Echo-Link** is a real-time audio streaming application designed to capture audio from a system's input device (e.g., microphone), encode it, transmit it over a network, decode it on the receiving end, and play it back through the system's output device (e.g., speakers). The project leverages modern C++ features, PortAudio for cross-platform audio I/O, Opus for high-quality audio compression, and ASIO for efficient networking.\n\n---\n\n## High-Level Architecture\n\nThe diagram above illustrates the main components and data flow in Echo-Link:\n\n1. **Audio Capture**\n   - `PortAudioCapture` interfaces with the OS audio subsystem (ALSA, Core Audio, WASAPI, etc.) via PortAudio.\n   - Captures raw PCM audio frames from the hardware audio input buffer (microphone).\n   - Frames are pushed into a thread-safe queue.\n\n2. **Audio Encoding**\n   - `AudioCodec` encodes PCM frames into compressed Opus packets for efficient network transmission.\n\n3. **Network Transmission**\n   - `NetworkManager` handles UDP-based asynchronous sending and receiving of audio packets using ASIO.\n   - Outgoing packets are sent to the remote peer; incoming packets are received and queued for decoding.\n\n4. **Audio Decoding**\n   - `AudioCodec` decodes received Opus packets back into PCM frames.\n\n5. **Audio Playback**\n   - `PortAudioPlayback` pulls decoded PCM frames from a queue and writes them to the hardware audio output buffer (speakers/headphones) via PortAudio.\n\n6. **ThreadSafeQueue**\n   - Generic, thread-safe queues are used throughout to safely pass audio frames and network packets between threads and modules.\n\n---\n\n## Main Classes and Responsibilities\n\n| Class/Interface         | Description                                                                                  |\n|------------------------|----------------------------------------------------------------------------------------------|\n| `Application`          | Central orchestrator. Manages modules, queues, and threads for encoding, decoding, and I/O.  |\n| `IAudioSource`         | Abstract interface for audio sources (capture).                                              |\n| `PortAudioCapture`     | Captures audio from the system input device using PortAudio.                                 |\n| `FakeAudioSource`      | Simulates an audio source by reading from a file (for testing).                             |\n| `IAudioPlayback`       | Abstract interface for audio playback devices.                                               |\n| `PortAudioPlayback`    | Plays audio to the system output device using PortAudio.                                     |\n| `AudioCodec`           | Encodes/decodes audio frames using the Opus codec.                                           |\n| `NetworkManager`       | Handles UDP networking using ASIO.                                                           |\n| `ThreadSafeQueue\u003cT\u003e`   | Thread-safe queue for passing data between modules/threads.                                  |\n\n---\n\n## Audio Data Flow\n\n1. **Capture:**\n   Audio is captured from the system's hardware audio input buffer via `PortAudioCapture`.\n\n2. **Encode:**\n   Captured PCM frames are encoded to Opus packets by `AudioCodec`.\n\n3. **Transmit:**\n   Encoded packets are sent over the network by `NetworkManager`.\n\n4. **Receive:**\n   Incoming packets are received by `NetworkManager` and queued for decoding.\n\n5. **Decode:**\n   Received Opus packets are decoded back to PCM frames by `AudioCodec`.\n\n6. **Playback:**\n   Decoded PCM frames are played back through the system's hardware audio output buffer via `PortAudioPlayback`.\n\n---\n\n## Building and Running\n\n### Prerequisites\n\n- C++17 or newer compiler\n- [PortAudio](http://www.portaudio.com/) (development headers and libraries)\n- [Opus](https://opus-codec.org/) (development headers and libraries)\n- [ASIO](https://think-async.com/Asio/) (standalone or Boost)\n- CMake (recommended for building)\n\n### Build Instructions\n\n```bash\nmkdir build\ncd build\ncmake ..\nmake\n```\n\n### Running\n\nAfter building, run the application binary. You may need to specify configuration parameters (e.g., input/output device, network peer address) depending on your setup.\n\n---\n\n## Extending Echo-Link\n\n- **Custom Audio Sources:** Implement the `IAudioSource` interface for new capture methods.\n- **Custom Playback Devices:** Implement the `IAudioPlayback` interface for new playback methods.\n- **Alternative Codecs:** Extend or replace `AudioCodec` for different audio codecs.\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheweird-kid%2Fecho-link","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheweird-kid%2Fecho-link","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheweird-kid%2Fecho-link/lists"}