Install pulseaudio with brew
brew install pulseaudio
NOTE: do not run pulseaudio
as service wth brew
. If started, stop the service.
brew services stop pulseaudio
Run as daemon:
pulseaudio --load=module-native-protocol-tcp --exit-idle-time=-1 --daemon
Verify running pulseaudio
:
pulseaudio --check -v
Run a docker container and test sound. You should be able to hear the audio on your Mac.
docker run -it -e PULSE_SERVER=docker.for.mac.localhost \
-v ~/.config/pulse:/home/pulseaudio/.config/pulse \
--entrypoint speaker-test \
--rm jess/pulseaudio -c 2 -l 1 -t wav
NOTE: the docker image used for this test jess/pulseaudio
.
NOTE: for other systems, may need to use --device /dev/snd
instead see: https://github.com/mviereck/x11docker/wiki/Container-sound:-ALSA-or-Pulseaudio