Skip to main content
  1. Posts/

Stream Audio Output to Android Devices over WIFI

·1 min
Linux Audio Stream Android
Table of Contents

Background
#

I start switching to Bluetooth earphone and speaker but that makes my PC isolated from the atmosphere. Have once considered to buy an USB adapter from Amazon but all of them are full of negative reviews and so I left PC out of the ecosystem.

With PulseAudio, audio can be easily streamed over internal network. To start with, I followed the guide to create a audio server over LAN and connect it with PulseDroid or Simple Protocol Player. The result is quite acceptable with about 100-200ms delay.

Guide
#

# Stop the pulseaudio server first
pulseaudio -k

pactl load-module module-null-sink sink_name=<sink_name> sink_properties=device.description=<sink_name>
pactl load-module module-simple-protocol-tcp rate=48000 format=s16le channels=2 source=<sink_name>.monitor record=true port=12345 listen=0.0.0.0

pulseaudio --start

After that, you can either set default sink or specify the sink by environment.

# Set default sink
pactl set-default-sink <sink_name>
# To switch back
# Find you original sink by
pactl list sinks short

# OR specify sink by environment
# For example, to play with mpv
PULSE_SINK=<sink_name> mpv video.mkv