截至发文起,WSL已经支持音频播放。
但是,想在Docker中音频播放还需要一些额外的操作。
在启动容器时设置环境变量
PULSE_SERVER=${PULSE_SERVER}
并映射目录
/mnt/wslg/:/mnt/wslg/
例如,docker-compose.yml
version: '3'
services:
model-scope-py3.8:
image: 63b8df96896c
command: bash
volumes:
- "./:/root/make_data_set_so-vits-svc"
- "/mnt/wslg/:/mnt/wslg/" #映射目录
tty: true
stdin_open: true
# ports:
# - "8080:8080"
environment:
- PULSE_SERVER=${PULSE_SERVER} #设置环境变量