将 Windows/Linux 电脑的音频共享到 Android 手机。
音频共享可以通过网络将 Windows/Linux 电脑的音频共享到 Android 手机,这样你的手机就成了电脑的扬声器。 (你无需购买新的扬声器😄)。
## 使用 Windows 图形用户界面
- 你需要一台装有 Windows 10 x86_64 的电脑和一部装有 Android 6.0(API 23)+ 的手机。
- 从 [最新版本](https://github.com/mkckr0/audio-share/releases/latest) 下载 APK 文件和 AudioShareServer.exe。
- 在电脑上打开 AudioShareServer.exe。 默认参数可能效果不错。 但你可能仍需检查 "主机 "部分。 它通常是局域网地址,如 "192.168.3.2"。 确保手机可以通过此 IP 地址连接电脑。 然后点击 "启动服务器 "按钮。
- 将 APK 安装到手机并打开。 修改 "Host "部分,确保与上一步的值相同,如 "192.168.3.2"。 点击"▶"按钮,欣赏音频🎶。
> 注意!!!**: 此应用程序目前不支持自动重新连接功能。 一旦应用程序被 Android 省电程序杀死或断开连接,音频播放就会停止。 建议将应用添加到电源保护器的白名单中。
## Usage for Windows/Linux CMD
- Your Linux distro must have a PipeWire. Rocky Linux 9 works well.
- Download the `audio-share-server-cmd-windows.zip` for Windows, the `audio-share-server-cmd-linux.tar.gz` for Linux.
- Uncompress the archive file.
- Find the LAN address of your computer, such as `192.168.3.2`. Then run `as-cmd -b 192.168.3.2` to start the server. It will use the default port `65530` and select a default audio endpoint.
- The Windows will ask you to add firewall rules automatically while Linux not. So you need to configure firewall manually if your Linux distribution enables firewall.
```sh
sudo firewall-cmd --add-rich-rule='rule family="ipv4" destination address="192.168.3.2" port port="65530" protocol="tcp" accept'
sudo firewall-cmd --add-rich-rule='rule family="ipv4" destination address="192.168.3.2" port port="65530" protocol="udp" accept'
sudo firewall-cmd --runtime-to-permanent
```
- Install APK to your phone and open it. Modify the "Host" part to make sure it's same as the value of previous step, such as `192.168.3.2`. Click "▶" button and enjoy the audio🎶.