Skip to content

perashanid/multi-bluetooth-device

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🎧 Dual Bluetooth Audio

Stream your PC's system audio to two Bluetooth headphones at the same time.

Python Platform License


What It Does

  • Captures system audio in real time (WASAPI loopback)
  • Duplicates the audio stream to two selected output devices simultaneously
  • Per-device volume control
  • Latency sync slider (±100 ms) to compensate for Bluetooth delay mismatch
  • Auto-detects Bluetooth headphones
  • Real-time level meters for input and both outputs
  • Dark-themed, modern PyQt6 GUI

Screenshot

Connect two BT headphones, hit Start, and both hear the same audio.


Quick Start

Option A — Run the pre-built .exe

  1. Download or build the app (see below)
  2. Go to dist/DualBluetoothAudio/
  3. Double-click DualBluetoothAudio.exe
  4. Select two output devices → click Start Streaming

Option B — Run from source

# Clone the repo
git clone https://github.com/your-username/dual-bluetooth-audio.git
cd dual-bluetooth-audio

# Install dependencies
pip install -r requirements.txt

# Launch
python src/main.py

Build the .exe Yourself

pip install pyinstaller
python -m PyInstaller --noconfirm --onedir --windowed \
  --name "DualBluetoothAudio" \
  --hidden-import sounddevice \
  --hidden-import _sounddevice_data \
  --hidden-import pycaw \
  --hidden-import pycaw.pycaw \
  --hidden-import comtypes \
  --hidden-import comtypes.stream \
  --add-data "src;src" \
  src/main.py

The output will be in dist/DualBluetoothAudio/.


Project Structure

bluetooth/
├── .gitignore
├── README.md
├── plan.md              # Detailed project plan & roadmap
├── requirements.txt
├── src/
│   ├── main.py          # Entry point
│   ├── audio_engine.py  # WASAPI capture + dual playback engine
│   ├── device_manager.py# Audio device enumeration
│   ├── gui.py           # PyQt6 dark-themed UI
│   └── utils.py         # Ring buffer, logging, helpers
└── dist/
    └── DualBluetoothAudio/
        └── DualBluetoothAudio.exe

Requirements

  • Windows 10 or 11
  • Python 3.10+ (if running from source)
  • Two Bluetooth headphones paired in Windows Settings
  • At least one Bluetooth adapter (two USB dongles recommended for guaranteed dual A2DP)

Python Dependencies

Package Purpose
sounddevice Cross-platform audio I/O (PortAudio)
numpy Audio buffer manipulation
PyQt6 GUI framework
pycaw Windows Audio Session API
comtypes COM interface for Windows audio

How It Works

  1. WASAPI Loopback Capture — Grabs whatever audio is playing on your PC
  2. Ring Buffer — Thread-safe buffer stores captured PCM frames
  3. Dual Output Streams — Two independent sounddevice output streams read from the buffer and play to your selected devices
  4. Volume & Sync — Per-device gain control + adjustable delay offset to align the two headphones

Known Limitations

Issue Workaround
Most built-in BT adapters support only 1 A2DP connection Use a second USB Bluetooth dongle
Latency varies between headphone models Use the sync slider to align
WASAPI loopback needs audio playing The app will work once sound starts

Roadmap

  • System audio capture (WASAPI loopback)
  • Dual simultaneous output
  • Per-device volume control
  • Latency sync adjustment
  • Dark-themed GUI
  • Standalone .exe build
  • Microphone input source option
  • Per-app audio capture
  • Auto-reconnect on disconnect
  • System tray mode
  • Audio EQ per channel

License

MIT — use it however you like.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages