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.
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):
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.
sudo apt-get install arecord ffmpeg