Skip to content

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Android → Windows SMTC Bridge

or so called MediaBridge.

This project mirrors the active Android media session into Windows System Media Transport Controls (SMTC). It synchronizes metadata, album art, playback state, timeline and supported controls. It does not forward audio. Optional bidirectional volume sync mirrors Android's media-stream volume and the Windows default output master volume in either direction.

Components

  • android/: Android 8.0+ application written in Kotlin and Jetpack Compose. The interface uses Material 3 dynamic color, asymmetric expressive shapes, large status surfaces and animated state transitions. The APK contains no native library and therefore runs natively on ARM64/armv8a devices.
  • windows/: dependency-free Windows 10/11 x64 console client written in C++/WinRT.

Android setup

  1. Install android-smtc-bridge-arm64-release.apk.
  2. Open Media Bridge and grant notification access. Android requires an enabled notification-listener component to enumerate other apps' active media sessions.
  3. Enable Wi-Fi, Bluetooth, or both.
  4. Leave Bidirectional volume enabled if both devices should track volume changes made on either side.
  5. Note the displayed IP address and six-digit PIN.

For Bluetooth, pair the phone in Windows Bluetooth settings first, then tap Make this phone discoverable in the Android app before connecting.

Windows usage

Wi-Fi:

smtc-bridge.exe --wifi 192.168.1.23 --pin 123456

The address shown by Android can also be pasted directly:

smtc-bridge.exe --wifi 192.168.1.23:45831 --pin 123456

Use a non-default Android port when necessary:

smtc-bridge.exe --wifi 192.168.1.23 --port 45832 --pin 123456

Bluetooth RFCOMM:

smtc-bridge.exe --bluetooth auto --pin 123456

auto tries paired Windows Bluetooth devices. A phone name or Bluetooth MAC address can be supplied instead.

Press Ctrl+C to stop. Windows play, pause, previous, next, stop and timeline seek requests are sent back to the active Android player.

If you wish to keep MediaBridge working in background, please adjust your battery settings to make the service work. Refer to https://dontkillmyapp.com for further instructions.

Security model

The six-digit PIN prevents accidental or casual control by other devices on the same LAN. The protocol is not encrypted. Use it only on a trusted local network; Bluetooth relies additionally on normal OS pairing.

Protocol

Both transports carry UTF-8 JSON objects separated by LF. The client first sends:

{"type":"hello","version":2,"pin":"123456"}

The server replies with an acknowledgement and then sends state objects. Commands use the following shape:

{"type":"command","action":"seek","positionMs":42000}

Valid actions are play, pause, toggle, previous, next, stop, and seek. Protocol v2 additionally carries volume and volumeSyncEnabled in state frames and accepts {"action":"volume","volume":0.5} commands. Frames are limited to 8 MiB by the Windows client.

Rebuilding

The checked-in source is complete. Android uses Gradle/AGP and JDK 17 or newer. Windows uses the Visual C++ Build Tools and Windows 10/11 SDK:

windows\build.cmd AndroidSmtcBuild\windows

Build caches and generated files are intentionally excluded from source control.

About

Mirror Android media sessions into Windows SMTC over Wi-Fi or Bluetooth

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages