gui: speakeruse 支持声卡选择(设备通道可配输出设备)

- playDeviceAudio 按 gui-prefs.deviceBridge.audio.device 用 aplay -D <dev> 播放
- 新增 audio:list IPC(aplay -L 枚举) + preload 暴露 audio.list
- renderer 设备通道新增 speakeruse 声卡下拉, 保存到 prefs
- 排除 hw: 裸设备(mono->stereo 需转换), 只留 default/pipewire/pulse/plughw
- 修复 USB 声卡无声音: mono WAV 播到仅立体声设备失败, 改用 plughw 自动转换

已用 mock 网关 + 源码直跑验证: voice -> via plughw:CARD=Audio,DEV=0 播放成功
This commit is contained in:
2026-08-21 11:26:55 +08:00
parent c0e92cceb1
commit 0393daa644
3 changed files with 94 additions and 2 deletions

View File

@ -48,4 +48,7 @@ contextBridge.exposeInMainWorld("homeagent", {
displays: {
list: () => ipcRenderer.invoke("displays:list"),
},
audio: {
list: () => ipcRenderer.invoke("audio:list"),
},
});