Stream Audio

May 15, 2025 Β· Tyler Yeager

Stream Audio
arecord -f cd | ffmpeg -re -i - -hide_banner -loglevel quiet -stats -acodec libmp3lame -ab 128k icecast://source:1234@$ip_addr:8000/a.mp3

For this, you’ll need to have ip_addr set for it to work Here’s a slightly longer version you can use as a function.

Terminal window
stream_my_audio() {
pw="1234"
echo "View at $1:8000/a.mp3 with password $pw"
arecord -f cd | ffmpeg -re -i - -hide_banner -loglevel quiet -stats -acodec libmp3lame -ab 128k icecast://source:${pw}@$1:8000/a.mp3
}

The audio stream will be available at your ipaddress + ":8000/a.mp3".
For example: http://192.168.1.10:8000/a.mp3.
To use (assuming your ip address is 192.168.1.10):

Terminal window
cat my_audio_file.mp3 | stream_my_audio 192.168.1.10

You will need to have both ffmpeg and arecord installed. This should work for Debian family OS’s.

Terminal window
sudo apt-get install arecord ffmpeg

Did you find this interesting?

Consider subscribing 😊

No AI-generated content or SEO garbage.

Unsubscribe anytime