Blog

A beginners guide to the Liquidsoap language

Published April 15, 2026 · Streamitter

A beginner's guide to the Liquidsoap language

For anyone diving into the world of online radio broadcasting, Liquidsoap is a name you’ll likely encounter. This powerful scripting language is designed to give broadcasters unparalleled control over their audio streams. Whether you're just starting out or looking to enhance your existing setup, understanding Liquidsoap can open up a world of possibilities. In this guide, we'll explore the essentials of Liquidsoap, providing you with the foundational knowledge to get started.

What is Liquidsoap?

Liquidsoap is a flexible, open-source language specifically crafted for creating audio streaming applications. It is a part of the Savonet project and has become a favorite among broadcasters for its versatility and robust features. At its core, Liquidsoap is designed to manage complex audio flows, allowing users to mix, encode, and stream audio with ease.

Why use Liquidsoap?

One of the standout features of Liquidsoap is its ability to handle a wide range of streaming scenarios. Whether you're interested in live broadcasts, automated playlists, or intricate audio processing, Liquidsoap offers the tools needed to achieve your goals. Additionally, its script-based approach means you can customize and extend functionality to suit your specific needs, making it a powerful choice for both novice and experienced broadcasters.

Getting started with Liquidsoap

Before delving into the specifics of Liquidsoap, you'll need to install it on your system. Liquidsoap is compatible with various operating systems, including Linux, macOS, and Windows. Installation instructions can often be found on the official Liquidsoap website or through package managers like apt for Debian-based systems or homebrew for macOS.

Understanding the basics

At its core, Liquidsoap scripts are composed of sources and outputs. Sources are the audio inputs you’ll be working with, such as files, URLs, or live inputs, while outputs are the destinations where your audio will be sent, such as an Icecast or SHOUTcast server.

Here’s a simple example to play an audio file:


# Define a source
my_source = single("/path/to/your/audio.mp3")

# Output to a local sound card for testing
output.alsa(my_source)

Creating playlists

Liquidsoap shines when it comes to creating dynamic playlists. You can easily define a playlist of audio files to be played in sequence or shuffled:


# Define a playlist
my_playlist = playlist("/path/to/your/playlist.m3u")

# Output the playlist to a streaming server
output.icecast(%mp3, host="localhost", port=8000, password="hackme", mount="/stream", my_playlist)

Advanced features

Liquidsoap offers a variety of advanced features for those looking to push the boundaries of traditional broadcasting. This includes:

  • Audio processing: Apply effects like normalization, fading, or compression to enhance your audio stream.
  • Dynamic sources: Use conditional logic to switch between different audio sources based on specific criteria, such as the time of day or listener count.
  • Metadata handling: Integrate metadata for tracks to provide listeners with real-time information about what’s currently playing.

Handling live inputs

Live broadcasting is a crucial aspect of many online radio stations. Liquidsoap allows you to easily incorporate live inputs into your streams, whether from a microphone, external mixer, or another live source:


# Define a live source
live_source = input.live()

# Mix the live source with a playlist
mixed_source = switch([({0m}, my_playlist), ({0h}, live_source)])

# Output to Icecast
output.icecast(%mp3, host="localhost", port=8000, password="hackme", mount="/stream", mixed_source)

Debugging and testing

Like any programming language, debugging is an essential part of working with Liquidsoap. The Liquidsoap interpreter provides helpful feedback when scripts contain errors, guiding you through the process of fixing issues. Additionally, testing your scripts locally before deploying them can save time and prevent potential broadcasting mishaps.

Conclusion

Liquidsoap is a powerful tool for anyone looking to create professional-grade audio streams. Its ability to manage complex audio workflows, combined with its scripting flexibility, makes it an invaluable resource for broadcasters. As you continue to explore Liquidsoap, you'll discover new ways to enhance your broadcasts and connect with your audience. If you're ready to take your streaming to the next level, dive into Liquidsoap and start experimenting today!

We hope this beginner's guide has provided you with the knowledge to start using Liquidsoap effectively. For more tips and resources, be sure to check back with Streamitter or join the Liquidsoap community forums. Happy broadcasting!