ChatGPT Audio Route

English | 中文

一个将 ChatGPT 语音播放路由到用户选择的蓝牙 A2DP 输出,并使用手机内置背部麦克风采集输入的 Xposed 模块。

An Xposed module that routes ChatGPT Voice playback to a user-selected Bluetooth A2DP output and captures input from the phone's built-in back microphone.

Scope

  • Public application ID: io.github.peiyingyao.chatgptvoiceroute
  • Target application: com.openai.chatgpt
  • Playback: selected AUDIO_DEVICE_OUT_BLUETOOTH_A2DP
  • Capture: AUDIO_DEVICE_IN_BACK_MIC
  • SCO is not required for the A2DP playback path.
  • No BLUETOOTH_CONNECT permission is requested; the selector lists A2DP outputs currently exposed as connected by Android.

The module has its own settings Activity. The route toggle and selected A2DP target are shared with the optional Voice-settings integration. If the target is unavailable, the module follows the documented fallback policy and otherwise leaves the native route intact.

When no complete target is persisted, the selector stays unset and native system routing remains active until the user chooses a connected A2DP output.

Build

From the repository root, use a JDK 17 runtime and an installed Gradle 8.x distribution:

$env:JAVA_HOME = '<path-to-jdk-17>'
gradle -p module test
gradle -p module :xposed:assembleDebug

Release signing is intentionally out-of-band. Set CHATGPT_ROUTE_KEYSTORE, CHATGPT_ROUTE_STORE_PASSWORD, and CHATGPT_ROUTE_KEY_ALIAS only in the local build environment, then run:

gradle -p module :xposed:assembleRelease

Do not commit signing keys, passwords, generated APKs, or local SDK configuration.

Install and configure

Install the generated APK, enable the module in a compatible Xposed/Vector manager, and grant the module's scope to com.openai.chatgpt. Open the module Activity to enable routing and choose one of the currently connected A2DP devices.

System-server observation and the legacy compatibility entry are retained only in development builds, not in public-release artifacts.

The module does not require a specific headset, Bluetooth name, MAC address, or Calls Audio setting. Those are runtime conditions that vary by device and Android build.

Repository layout

  • module/src/main/java: shared routing contracts and policy.
  • module/xposed/src/main/java: Xposed entry points, settings UI, provider bridge, and audio hooks.
  • module/src/test/java: JVM policy and contract tests.
  • docs/decisions: public behavior and compatibility decisions.
  • docs/public-release.md: release scope and privacy boundary.

License

This project is licensed under the MIT License. See LICENSE.

Releases

0.1.0

Stable

9/17/2026, 9:18:12 AM

0.1.0

  • 将 ChatGPT Voice 的播放路由到用户选择的蓝牙 A2DP 输出。
    Route ChatGPT Voice playback to a user-selected Bluetooth A2DP output.
  • 优先使用手机内置的背部麦克风进行 Voice 收音。
    Prefer the phone's built-in back microphone for Voice capture.
  • 将路由作用域限定为 com.openai.chatgpt,不改写全局 Android 音频策略。
    Keep routing scoped to com.openai.chatgpt without rewriting global Android audio policy.
  • 未选择或没有可用的 A2DP 目标时,保留原生路由。
    Preserve native routing when no A2DP target is selected or available.
  • 系统服务器观测和旧版兼容入口不包含在正式公开包中。
    Keep system-server observation and the legacy compatibility entry out of the public artifact.

Assets

1