szync is a lightweight, high-performance C++ utility for Windows that captures system audio in real-time and routes it to multiple playback devices simultaneously with ultra-low latency and automatic clock-drift correction.
%%{init: {'theme': 'dark', 'themeVariables': { 'primaryColor': '#1e1e2e', 'primaryTextColor': '#cdd6f4', 'primaryBorderColor': '#89b4fa', 'lineColor': '#a6adc8', 'secondaryColor': '#181825', 'tertiaryColor': '#11111b'}}}%%
graph TD
%% Node Definitions
Capture["Windows System Audio Capture<br/>(WASAPI Loopback / Process Filter)"]:::capture
subgraph Engine ["szync Core Routing Engine"]
Coordinator["Audio Coordinator"]:::coordinator
Buffer1["Lock-Free SPSC Ring Buffer 1"]:::buffer
Buffer2["Lock-Free SPSC Ring Buffer 2"]:::buffer
BufferN["Lock-Free SPSC Ring Buffer N"]:::buffer
end
subgraph Threads ["Real-time MMCSS Render Threads"]
Render1["Render Loop 1<br/>Resampler / Channel Map / DSP"]:::render
Render2["Render Loop 2<br/>Resampler / Channel Map / DSP"]:::render
RenderN["Render Loop N<br/>Resampler / Channel Map / DSP"]:::render
end
subgraph Output ["Playback Hardware Devices"]
Dev1["Wired Headphones"]:::hardware
Dev2["Bluetooth Speaker"]:::hardware
DevN["USB DAC / Interface"]:::hardware
end
%% Flows
Capture -->|Raw Float PCM Samples| Coordinator
Coordinator -->|Lock-Free Push| Buffer1
Coordinator -->|Lock-Free Push| Buffer2
Coordinator -->|Lock-Free Push| BufferN
Buffer1 -->|Lock-Free Pop| Render1
Buffer2 -->|Lock-Free Pop| Render2
BufferN -->|Lock-Free Pop| RenderN
Render1 -->|Active Volume & Clock Correct| Dev1
Render2 -->|Active Volume & Clock Correct| Dev2
RenderN -->|Active Volume & Clock Correct| DevN
%% Styling classes
classDef capture fill:#1e1e2e,stroke:#f5c2e7,stroke-width:2px,color:#cdd6f4;
classDef coordinator fill:#313244,stroke:#89b4fa,stroke-width:2px,color:#cdd6f4;
classDef buffer fill:#1e1e2e,stroke:#a6e3a1,stroke-width:2px,color:#cdd6f4;
classDef render fill:#313244,stroke:#f9e2af,stroke-width:2px,color:#cdd6f4;
classDef hardware fill:#181825,stroke:#94e2d5,stroke-width:2px,color:#cdd6f4;
- Real-time Capture: Uses event-driven Windows WASAPI loopback capture (either system-wide or isolated by application process).
- Lock-Free Buffering: Audio is routed via single-producer single-consumer (SPSC) ring buffers running on high-priority MMCSS (
Pro Audio) threads. - Clock-Drift Correction: Active occupancy monitoring skips frames dynamically to avoid buffer overflows and stutters between hardware devices.
- Automatic Resampling: Built-in linear resampler and channel mapper handle format conversion automatically if the device driver doesn't support it natively.
The D3D11-accelerated dark-mode GUI manages everything dynamically:
- Multi-Device Routing Matrix: Toggle outputs dynamically.
- Custom Aliasing & Volumes: Rename devices inline and control volumes.
- Application Process Filters: Isolate audio captures to specific apps.
- Auto-Saving: Saves all changes instantly to
%APPDATA%\szync\szync_config.ini.
- Windows 10 / 11
- MinGW-w64 (GCC) compiler toolchain (with
g++added to your systemPATH).
- Double-click
build.bator run it from a terminal to compileszync.exe. - Run
szync.exein the root folder.
- Alternatively, download pre-compiled versions from the Releases section.
szync/
├── build.bat # Compilation script
├── README.md # Project documentation
├── src/
│ ├── main.cpp # Win32 & DirectX11 ImGui rendering loop
│ ├── audio_engine.h # Real-time capture & routing logic
│ ├── config_manager.h # INI settings manager
│ └── process_utils.h # Process helper functions
└── thirdparty/imgui/ # User interface library
Open-source under the MIT License.