รวมช่าง

ศูนย์รวมช่างฝีมือทุกสาขาอาชีพ

เสียงตามสาย IP-PA
create live audio streaming server
By itdhivii 2 weeks ago 3 min read
Share Tweet Share

cisco-finesse-webrtc-recording2.jpg



OIP.webp

 true live audio streaming (like internet radio) with full server + management setup.
We’ll use Icecast (server) + Liquidsoap (streaming script) because it’s free, stable, and easy to automate.

Here’s the full working setup.


1. Server Setup (Ubuntu example)

Install Icecast

sudo apt update
sudo apt install icecast2

During install, it will ask for:

  • Hostname: your domain or server IP (e.g., radio.example.com)

  • Admin password → set something secure

  • Source password → for your streaming software

If you missed it, you can edit later in:

sudo nano /etc/icecast2/icecast.xml

Example config changes:

<authentication>
<admin-user>admin</admin-user>
<admin-password>adminpass</admin-password>
<source-password>sourcepass</source-password>
</authentication>
<hostname>your-server-ip-or-domain</hostname>

Restart Icecast:

sudo systemctl restart icecast2
sudo systemctl enable icecast2

Test: Visit

http://your-server-ip:8000

You should see Icecast’s status page.


2. Install Liquidsoap (stream manager)

Liquidsoap lets you manage playlists, live mics, and transitions.

sudo apt install liquidsoap

3. Create a Streaming Script

Create a script file:

nano ~/radio.liq

Example script for live + fallback playlist:

# Mount point name
output_mount = "/stream.mp3"
# Stream settings
output_bitrate = 128
output_format = %mp3
# Fallback playlist
playlist = playlist("~/music") # folder with mp3s
playlist = crossfade(2.0, playlist)
# Live input (microphone or live DJ feed)
live = input.harbor("live", password="livepass", port=8005)
# Fallback to playlist if no live feed
radio = fallback([live, playlist])
# Stream to Icecast server
output.icecast(
%mp3(bitrate=output_bitrate, stereo=true),
host="localhost", port=8000,
password="sourcepass", mount=output_mount,
name="My Live Radio",
description="Live streaming test",
radio
)

4. Start Streaming

Run:

liquidsoap ~/radio.liq

This will connect to Icecast and start broadcasting.


5. Listen on Web

Embed player in your website:

<audio controls autoplay>
<source src="http://your-server-ip:8000/stream.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>

6. Management Features

  • Upload new MP3s to ~/music folder — Liquidsoap will auto-play them.

  • Connect a live DJ feed to live mount using BUTT or Mixxx (set host, port, and livepass).

  • Monitor listeners and streams at http://your-server-ip:8000/admin (login with adminpass).


Pros of this setup:

  • Works with any modern browser

  • Supports live mic + auto playlist fallback

  • Easily expandable for multiple channels


If you want, I can give you an upgraded Liquidsoap script that has:

  • Auto crossfade

  • Jingle scheduling

  • Multiple DJs with passwords

  • Auto record live shows

That will make it like a mini radio station control panel.




itdhivii

home wecare

Signin to able to comment !

Comments

This is the first post

This is the last post