Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,32 @@ jobs:
}

- run: dotnet test tests/VolumeBridge.Tests -c Release
- run: dotnet publish src/VolumeBridge -c Release -r win-x64 -o out

- name: Build installer
- name: Build single exe
shell: pwsh
run: |
choco install innosetup -y --no-progress
$iscc = "${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe"
& $iscc "/DAppVersion=${{ steps.ver.outputs.version }}" "/DPayloadDir=$PWD\out" "/O$PWD\installer\output" installer\VolumeBridge.iss
if ($LASTEXITCODE -ne 0) { throw "ISCC failed" }
$h = (Get-FileHash installer\output\VolumeBridgeSetup.exe -Algorithm SHA256).Hash.ToLowerInvariant()
"$h VolumeBridgeSetup.exe" | Set-Content -NoNewline -Encoding ascii installer\output\VolumeBridgeSetup.exe.sha256
if (Test-Path dist) { Remove-Item -Recurse -Force dist }
dotnet build src/VolumeBridge -c Release "-p:ApoDll=$PWD\out\VolumeBridgeApo.dll" -p:RequireApo=true -o dist
if ($LASTEXITCODE -ne 0) { throw "dotnet build failed" }
$files = @(Get-ChildItem -Force dist)
if ($files.Count -ne 1 -or $files[0].Name -ne 'VolumeBridge.exe') {
$names = ($files | ForEach-Object Name) -join ', '
throw "dist must contain only VolumeBridge.exe, found: $names"
}
$size = $files[0].Length
"VolumeBridge.exe size: $size bytes ($([math]::Round($size / 1KB, 1)) KB / $([math]::Round($size / 1MB, 2)) MB)"
if ($size -gt 5MB) {
throw "VolumeBridge.exe is $size bytes, exceeding the 5 MB limit"
}
$h = (Get-FileHash dist\VolumeBridge.exe -Algorithm SHA256).Hash.ToLowerInvariant()
"$h VolumeBridge.exe" | Set-Content -NoNewline -Encoding ascii dist\VolumeBridge.exe.sha256

- uses: actions/upload-artifact@v4
with:
name: VolumeBridgeSetup
name: VolumeBridge
path: |
installer/output/VolumeBridgeSetup.exe
installer/output/VolumeBridgeSetup.exe.sha256
dist/VolumeBridge.exe
dist/VolumeBridge.exe.sha256
if-no-files-found: error

- name: Publish release
Expand All @@ -78,5 +86,5 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create $env:GITHUB_REF_NAME installer/output/VolumeBridgeSetup.exe installer/output/VolumeBridgeSetup.exe.sha256 `
gh release create $env:GITHUB_REF_NAME dist/VolumeBridge.exe dist/VolumeBridge.exe.sha256 `
--title "VolumeBridge $env:GITHUB_REF_NAME" --notes-file docs/release-notes.md --verify-tag
30 changes: 18 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,33 @@ VolumeBridge attenuates the audio inside the Windows audio engine before it reac

## Install and use

**Requirements:** Windows 10 (1903+) or Windows 11, 64-bit (x64). Administrator rights are needed to install; the app itself runs without elevation.
**Requirements:** Windows 10 (1903+) or Windows 11, 64-bit (x64). Portable single executable — no installer needed. One administrator (UAC) prompt is needed to enable or remove the plugin; the app itself runs without elevation.

> **Upgrading from 0.4.0 or earlier:** Uninstall the old installed version in **Settings → Apps** first, then run the new `VolumeBridge.exe`.

1. **Switch your speaker to USB audio mode** and connect it to your PC. On the JBL Flip 6, hold **Bluetooth + Play for about 10 seconds** (check your model's instructions if using another speaker). **Quit Voicemeeter** if it is running so it does not hold the speaker exclusively.
2. **Download and run `VolumeBridgeSetup.exe`** from the [latest release](https://github.com/ZanderH-code/volumebridge/releases/latest). Keep **"Enable the zero-latency volume plugin"** ticked. Windows audio will pause for about 2 seconds during setup.
3. **Open VolumeBridge** and click **Set as default output**.
4. **Check the status and enable startup:** play audio and confirm the window shows **● Working (zero latency)**, then tick **Start at logon**.
2. **Download and run `VolumeBridge.exe`** from the [latest release](https://github.com/ZanderH-code/volumebridge/releases/latest) (place it anywhere you like). Because the executable is unsigned, Windows SmartScreen may show a warning — click **More info → Run anyway**.
3. **Click Enable plugin** (one UAC prompt). Windows audio will pause for about 2 seconds while the plugin is registered.
4. **Click Set as default output**, play audio to confirm the window shows **● Working (zero latency)**, then tick **Start at logon**.

### Everyday controls

- **Max volume cap:** Defaults to **-12 dB** so 100% on the Windows slider is not deafening. Adjustable in the window from **0 to -30 dB**.
- **Output device picker:** Automatically picks a playback device whose name contains `JBL` or `Zgmicro`, or you can select another device manually.
- **Window and tray:** Closing the window minimizes VolumeBridge to the system tray so it stays out of the way.
- **Language:** Choose English or 简体中文 in the installer, and switch anytime in the app.
- **Updates:** One-click update check from GitHub Releases (downloads are SHA-256 verified).
- **Clean uninstall:** Uninstalling from Settings → Apps restores all original Windows audio settings.
- **Language:** Follows your Windows display language by default, and switches between English and 简体中文 anytime in the app.
- **Updates:** One-click update check from GitHub Releases (downloads are SHA-256 verified and update the exe in place).
- **Clean uninstall:** Click **Remove plugin** in the window (restores all original Windows audio settings and removes the logon task), then quit and delete `VolumeBridge.exe`.

## Trade-offs and troubleshooting

Zero-latency mode modifies one Windows audio setting so the plugin can load. Know these trade-offs before installing:
Zero-latency mode modifies one Windows audio setting so the plugin can load. Know these trade-offs before enabling it:

- **Protected audio path is turned off (`DisableProtectedAudioDG=1`):** The plugin is not signed by Microsoft, so Windows needs this setting to load it (Equalizer APO does the same). A few DRM players (such as certain protected 4K audio streams) may be affected.
- **Keep Audio enhancements on:** In **Settings → System → Sound → [your speaker]**, **Audio enhancements** must stay set to **Device Default Effects**. Turning it off makes Windows skip the plugin.
- **Exclusive mode bypasses the plugin:** Apps that take exclusive WASAPI control bypass the Windows audio engine and will not be attenuated.
- **USB port changes or Windows feature updates:** Moving the speaker to a different USB port or installing a major Windows update can drop the plugin setting. The VolumeBridge window will tell you, and clicking **Enable plugin** restores it.
- **If sound stops working after installing:** Uninstall VolumeBridge in **Settings → Apps** (which restores everything), or set the speaker's **Audio enhancements** to **Off**.
- **If sound stops working after enabling:** Click **Remove plugin** in VolumeBridge (which restores everything), or set the speaker's **Audio enhancements** to **Off**.

## Supported devices

Expand Down Expand Up @@ -94,16 +96,20 @@ Settings in `%LOCALAPPDATA%\VolumeBridge\config.json`:
| `maxOutputDb` | `-12` | Output level at 100% slider (dB); `0` = speaker's full level |
| `outputKeywords` | `["JBL", "Zgmicro"]` | Case-insensitive name keywords for automatic device selection |
| `outputDeviceId` | `null` | Fixed output endpoint ID (set by the device picker) |
| `language` | `"auto"` | `"en"`, `"zh"`, or `"auto"` (follows installer choice) |
| `language` | `"auto"` | `"en"`, `"zh"`, or `"auto"` (follows Windows display language) |

## Building from source

```powershell
# 1. Build the C++ APO DLL (from a Visual Studio x64 Developer Prompt)
./apo/build.ps1 -Out "$PWD\out"

# 2. Run tests and build the portable single exe (.NET Framework 4.8)
dotnet test tests/VolumeBridge.Tests
dotnet publish src/VolumeBridge -c Release -r win-x64 -o out
dotnet build src/VolumeBridge -c Release "-p:ApoDll=$PWD\out\VolumeBridgeApo.dll" -p:RequireApo=true -o dist
```

The GitHub Actions workflow (`.github/workflows/build.yml`) builds the C++ APO (`apo/`) and the Inno Setup installer on Windows, and publishes a GitHub Release on every `v*` tag. Design notes and history are in [docs/PLAN.md](docs/PLAN.md) (Chinese).
The GitHub Actions workflow (`.github/workflows/build.yml`) builds the C++ APO (`apo/`) and embeds it into the single portable `VolumeBridge.exe` on Windows, and publishes a GitHub Release on every `v*` tag. Design notes and history are in [docs/PLAN.md](docs/PLAN.md) (Chinese).

## Credits and licenses

Expand Down
30 changes: 18 additions & 12 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,33 @@ VolumeBridge 在 Windows 音频引擎内部、声音发往音箱之前,按系

## 安装与使用

**系统要求:** Windows 10(1903 及以上)或 Windows 11,64 位(x64)。安装时需要管理员权限,平时以普通权限运行。
**系统要求:** Windows 10(1903 及以上)或 Windows 11,64 位(x64)。绿色单文件,无需安装。启用或移除插件时需要一次管理员(UAC)确认,平时以普通权限运行。

> **从 0.4.0 及更早版本升级:** 请先在 **设置 → 应用** 中卸载旧的安装版,再运行新版 `VolumeBridge.exe`。

1. **把音箱切到 USB 音频模式**并连上电脑。JBL Flip 6 的操作是同时按住**蓝牙键 + 播放键约 10 秒**(其他型号请按对应方式操作)。如果正在运行 Voicemeeter,**请先退出**,避免它独占音箱。
2. **下载并运行 `VolumeBridgeSetup.exe`**(前往 [最新 Release](https://github.com/ZanderH-code/volumebridge/releases/latest))。安装时保持勾选**“现在为音箱启用零延迟音量插件”**。过程中 Windows 声音会中断约 2 秒。
3. **打开 VolumeBridge**,点击**设为默认输出**。
4. **确认生效并设置自启:** 播放任意声音,看到窗口显示 **● 正在工作(零延迟)** 即表示生效;勾选**开机自动启动**即可。
2. **下载并运行 `VolumeBridge.exe`**(前往 [最新 Release](https://github.com/ZanderH-code/volumebridge/releases/latest),放在任意文件夹即可)。由于程序未做代码签名,Windows SmartScreen 可能会弹出提示,点击**更多信息 → 仍要运行**即可。
3. **点击启用插件**(一次 UAC 管理员确认)。过程中 Windows 声音会中断约 2 秒。
4. **点击设为默认输出**,播放任意声音确认窗口显示 **● 正在工作(零延迟)**,再勾选**开机自动启动**即可。

### 日常使用

- **最大音量上限:** 默认 **-12 dB**,避免滑块拉满时震耳欲聋;可在窗口中自由调节(**0 到 -30 dB**)。
- **输出设备选择:** 默认自动匹配名称包含 `JBL` 或 `Zgmicro` 的播放设备,也可以在下拉框里手动指定其他设备。
- **窗口与托盘:** 关闭窗口后会隐藏到系统托盘继续运行,不占任务栏。
- **界面语言:** 支持简体中文 / English,安装时选择,也可以在程序里随时切换。
- **检查更新:** 支持从 GitHub Releases 一键更新(下载包会做 SHA-256 校验)。
- **干净卸载:** 在“设置 → 应用”中卸载 VolumeBridge 时,会自动恢复所有被修改的 Windows 音频设置。
- **界面语言:** 默认跟随 Windows 显示语言,也可在程序里随时切换简体中文 / English。
- **检查更新:** 支持从 GitHub Releases 一键原地更新(下载文件会做 SHA-256 校验)。
- **干净卸载:** 在窗口中点击**移除插件**(会自动恢复所有被修改的 Windows 音频设置并取消开机自启),然后退出并删除 `VolumeBridge.exe` 即可。

## 代价与排障

零延迟模式需要改动一项 Windows 音频设置以加载插件,安装前请了解以下几点:
零延迟模式需要改动一项 Windows 音频设置以加载插件,启用前请了解以下几点:

- **需要关闭受保护音频路径(`DisableProtectedAudioDG=1`):** 插件未经微软签名,Windows 需要关闭此项才能加载它(Equalizer APO 也是同样做法)。少数 DRM 播放器(如部分受保护的 4K 音频流)可能受影响。
- **保持“音频增强”开启:** 在 **设置 → 系统 → 声音 → 该音箱** 中,**音频增强**必须保持为**设备默认效果**。如果改成“关”,Windows 会跳过插件。
- **独占模式会绕过插件:** 以 WASAPI 独占模式播放的程序不经过 Windows 音频引擎,音量插件不会生效。
- **换 USB 口或 Windows 大版本更新:** 换插 USB 口或升级 Windows 大版本后,插件设置可能被重置。窗口会提示状态异常,点一下**启用插件**即可恢复。
- **如果装完后没声音:** 直接在**设置 → 应用**中卸载 VolumeBridge(会还原所有设置),或者把该音箱的**音频增强**改成**关**。
- **如果启用后没声音:** 在 VolumeBridge 中点击**移除插件**(会还原所有设置),或者把该音箱的**音频增强**改成**关**。

## 兼容性与支持设备

Expand Down Expand Up @@ -94,16 +96,20 @@ Voicemeeter 需要经过虚拟声卡再二次输出,会引入延迟、占用
| `maxOutputDb` | `-12` | 滑块 100% 时的输出上限(dB),`0` 表示音箱原始最大音量 |
| `outputKeywords` | `["JBL", "Zgmicro"]` | 自动识别输出设备的名称关键字(不区分大小写) |
| `outputDeviceId` | `null` | 固定指定的输出设备 ID(由界面下拉框写入) |
| `language` | `"auto"` | `"zh"` / `"en"`,`"auto"` 跟随安装时的语言选择 |
| `language` | `"auto"` | `"zh"` / `"en"`,`"auto"` 跟随 Windows 显示语言 |

## 从源码构建

```powershell
# 1. 构建 C++ APO 插件(在 Visual Studio x64 开发者命令提示符中)
./apo/build.ps1 -Out "$PWD\out"

# 2. 运行测试并构建绿色单文件 exe(.NET Framework 4.8)
dotnet test tests/VolumeBridge.Tests
dotnet publish src/VolumeBridge -c Release -r win-x64 -o out
dotnet build src/VolumeBridge -c Release "-p:ApoDll=$PWD\out\VolumeBridgeApo.dll" -p:RequireApo=true -o dist
```

GitHub Actions(`.github/workflows/build.yml`)会在 Windows 上构建 C++ 音量插件(`apo/`)与 Inno Setup 安装包,并在推送 `v*` 标签时自动发布 Release。设计思路与评审记录见 [docs/PLAN.md](docs/PLAN.md)。
GitHub Actions(`.github/workflows/build.yml`)会在 Windows 上构建 C++ 音量插件(`apo/`)并嵌入单个绿色版 `VolumeBridge.exe`,并在推送 `v*` 标签时自动发布 Release。设计思路与评审记录见 [docs/PLAN.md](docs/PLAN.md)。

## 致谢与许可

Expand Down
26 changes: 26 additions & 0 deletions THIRD-PARTY-NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,29 @@ The above copyright notice and this permission notice shall be included in all c

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
```

## PolySharp

Build-time source generator only (https://github.com/Sergio0694/PolySharp); no runtime assembly is redistributed. Licensed under the MIT License:

```
Copyright (c) 2022 Sergio Pedri

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
2 changes: 2 additions & 0 deletions docs/PLAN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# VolumeBridge 实施计划

> **现状(0.5.0)**:改为基于 Windows 10 1903+/11 自带 .NET Framework 4.8 的**绿色单文件 `VolumeBridge.exe`**(内置 NAudio 与 `VolumeBridgeApo.dll`,移除 Inno Setup 安装包),支持程序内直接部署/更新/移除插件与原地自更新。
>
> **现状(0.4.0)**:产品只保留**零延迟 APO 模式**(`apo/VolumeBridgeApo.cpp`,音箱端点效果 EFX),已在 JBL Flip 6 + Windows 11 26H2 上实测可用。下文的 v3 虚拟音箱方案(USB/IP + UAC1)曾作为 0.2.x–0.3.x 的"兼容模式"发布,0.4.0 起已移除,代码保留在 Git 历史中(标签 v0.3.3 及以前)。
>
> APO 调试中的关键经验:
Expand Down
12 changes: 9 additions & 3 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
**中文** — 下载下面的 `VolumeBridgeSetup.exe` 运行即可。安装前请退出 Voicemeeter。使用说明见 [README](https://github.com/ZanderH-code/volumebridge/blob/main/README.zh-CN.md)。
**中文** — 下载下面的 `VolumeBridge.exe` 直接运行即可(无需安装)。首次运行前请退出 Voicemeeter。使用说明见 [README](https://github.com/ZanderH-code/volumebridge/blob/main/README.zh-CN.md)。

**English** — Download and run `VolumeBridgeSetup.exe` below. Quit Voicemeeter first. See the [README](https://github.com/ZanderH-code/volumebridge/blob/main/README.md).
**English** — Download and run `VolumeBridge.exe` below (portable, no installer). Quit Voicemeeter first. See the [README](https://github.com/ZanderH-code/volumebridge/blob/main/README.md).

`VolumeBridgeSetup.exe.sha256` is used by the in-app updater to verify the download.
`VolumeBridge.exe.sha256` is used by the in-app updater to verify the download.

### 0.5.0
- 改为单个绿色可执行文件 `VolumeBridge.exe`(基于 Windows 自带的 .NET Framework 4.8,不到 1 MB,取代原来的 67 MB 安装包)。 / Single portable `VolumeBridge.exe` targeting in-box .NET Framework 4.8 (under 1 MB instead of the 67 MB installer); no installer needed.
- 插件部署与卸载直接内置到程序中:点**启用插件**会释放并注册内置的零延迟插件;新增**移除插件**按钮一键还原音频设置、注销插件并取消开机自启。 / Plugin deploy and removal are built into the exe: **Enable plugin** extracts and registers the embedded APO; new **Remove plugin** button restores audio settings, unregisters the plugin, and removes autostart.
- 支持单文件原地一键更新;如果移动了 `VolumeBridge.exe` 的位置,启动时会自动同步开机自启任务路径。 / In-place single-exe self-update; moving `VolumeBridge.exe` automatically updates the logon task path at startup.
- **从 0.4.0 升级注意:** 由于不再提供安装包资产,0.4.0 内置的更新检查会提示“已是最新版本”,请先在 **设置 → 应用** 中卸载 0.4.0,再手动下载本版本的 `VolumeBridge.exe`。 / **Upgrading from 0.4.0:** 0.4.0's updater will report "latest" because the setup asset is gone — uninstall 0.4.0 in **Settings → Apps** first, then download `VolumeBridge.exe` manually.

### 0.4.0
- 只保留零延迟模式:移除兼容(虚拟音箱)模式,安装包不再附带 usbip-win2 驱动,体积明显变小、界面更简单。 / Zero-latency mode only: the compatible (virtual speaker) mode is removed and usbip-win2 is no longer bundled; smaller installer, simpler window.
Expand Down
Loading
Loading