%
(string, [(string*string)]) -> string
(pattern % [...,(k,v),...]) replaces in pattern occurences of: - '$(k)' into "v"; - '$(if $(k2),"a","b")' into "a" if k2 is found in the list, "b" otherwise.
^
(string, string) -> string
Concatenate strings.
add
(?id:string, ?normalize:bool, ?weights:[int], [source]) -> source
Add sources, with normalization
[source] (unlabeled)
string id ""
Force the value of the source ID
bool normalize true
[int] weights [ ]
Relative weight of the sources in the sum. The empty list stands for the homogeneous distribution.
add_protocol
(string, ((string, float) -> [string])) -> unit
Register a new protocol.
and
(bool, bool) -> bool
Return the conjunction of its arguments
append
(?id:string, ?merge:bool, source, (([(string*string)]) -> source)) -> source
Append an extra track to every track.Set the metadata 'liq_append' to 'false' to inhibit appending on one track.
([(string*string)]) -> source (unlabeled)
Given the metadata, build the source producing the track to append. This source is allowed to fail (produce nothing) if no relevant track is to be appended.
source (unlabeled)
string id ""
Force the value of the source ID
bool merge false
Merge the track with its appended track.
assoc
(string, [(string*string)]) -> string
assoc k [...,(k,v),...] = v
blank
(?id:string, ?duration:float) -> source
This source is not very noisy :)
float duration 0.
Duration of blank tracks, default means forever.
string id ""
Force the value of the source ID
change_volume
(?id:string, float, source) -> source
Scales the amplitude of the signal
source (unlabeled)
float (unlabeled)
multiplicative factor
string id ""
Force the value of the source ID
cross
(?id:string, ?duration:float, ?inhibit:float, ?minimum:float, ((source, source) -> source), source) -> source
Generic cross operator, allowing the composition of the N last seconds of a track with the beginning of the next track.
source (unlabeled)
(source, source) -> source (unlabeled)
Composition of an end of track and the next track.
float duration 5.
Duration in seconds of the crossed end of track. This value can be set on a per-file basis using the metadata field 'liq_start_next' (float in seconds).
string id ""
Force the value of the source ID
float inhibit -1.
Minimum delay between two transitions. It is useful in order to avoid that a transition is triggered on top of another when an end-of-track occurs in the first one. Negative values mean 'same as duration'.
float minimum -1.
Minimum duration (in sec.) for a cross: If the track ends without any warning (e.g. in case of skip) there may not be enough data for a decent composition. Set to 0. to avoid having transitions after skips, or more to avoid transitions on short tracks. With the negative default, transitions always occur.
delay
(?id:string, float, source) -> source
Prevents the child from being ready again too fast after a end of track
source (unlabeled)
float (unlabeled)
The source won't be ready less than this amount of seconds after any end of track
string id ""
Force the value of the source ID
fade.final
(?id:string, ?duration:float, source) -> source
Fade a stream to silence.
source (unlabeled)
float duration 3.
string id ""
Force the value of the source ID
fade.in
(?id:string, ?duration:float, source) -> source
Fade the beginning of tracks. Metadata 'liq_fade_in' can be used to set the duration for a specific track (float in seconds).
source (unlabeled)
float duration 3.
string id ""
Force the value of the source ID
fade.initial
(?id:string, ?duration:float, source) -> source
Fade the beginning of a stream.
source (unlabeled)
float duration 3.
string id ""
Force the value of the source ID
fade.out
(?id:string, ?duration:float, source) -> source
Fade the end of tracks. Metadata 'liq_fade_out' can be used to set the duration for a specific track (float in seconds).
source (unlabeled)
float duration 3.
string id ""
Force the value of the source ID
fallback
(?id:string, ?track_sensitive:bool, ?before:float, ?transitions:[(source, source) -> source], [source]) -> source
At the beginning of each track, select the first ready child.
[source] (unlabeled)
Select the first ready source in this list.
float before 0.
EXPERIMENTAL: for track_sensitive switches, trigger transitions before the end of track.
string id ""
Force the value of the source ID
bool track_sensitive true
Re-select only on end of tracks
[(source, source) -> source] transitions [ ]
Transition functions, padded with (fun (x,y) -> y) functions.
filter
(?id:string, ~freq:int, ~q:float, ~mode:string, source) -> source
Perform several kinds of filtering on the signal
source (unlabeled)
int freq
string id ""
Force the value of the source ID
string mode
low|high|band|notch
float q
get_process_lines
(string) -> [string]
Perform a shell call and return the list of its output lines.
get_process_output
(string) -> string
Perform a shell call and return its output.
input.http
(?id:string, ?autostart:bool, string) -> source
Forwards the given ogg/vorbis http stream. The relay can be paused/resumed using the start/stop telnet commands.
string (unlabeled)
URL of an http ogg stream (default port is 8000).
bool autostart true
Initially start relaying or not.
string id ""
Force the value of the source ID
input.http.mp3
(?id:string, string, ?autostart:bool, ?samplefreq:int) -> source
Forwards the given MP3 http stream. The relay can be paused/resumed using the start/stop telnet commands.
string (unlabeled)
URL of an http mp3 stream (default port is 8000).
bool autostart true
Initially start relaying or not.
string id ""
Force the value of the source ID
int samplefreq 44100
Samplefreq of the input stream.
mix
(?id:string, [source]) -> source
Mixing table controllable via the telnet interface.
[source] (unlabeled)
string id ""
Force the value of the source ID
on_blank
(?id:string, (() -> unit), ?threshold:float, ?length:float, source) -> source
Calls a given handler when detecting a blank
source (unlabeled)
() -> unit (unlabeled)
string id ""
Force the value of the source ID
float length 20.
Maximum silence length allowed.
float threshold 100.
Intensity threshold under which the stream is considered to be blank.
on_metadata
(?id:string, (([(string*string)]) -> unit), source) -> source
Call a given handler on metadata packets.
source (unlabeled)
([(string*string)]) -> unit (unlabeled)
Function called on every metadata packet in the stream. It should be fast because it is ran in the main thread.
string id ""
Force the value of the source ID
or
(bool, bool) -> bool
Return the disjunction of its arguments
output.ao
(?id:string, ?start:bool, ?driver:string, ?options:[(string*string)], source) -> source
Output stream to local sound card using libao.
source (unlabeled)
string driver ""
libao driver to use
string id ""
Force the value of the source ID
[(string*string)] options [ ]
List of parameters, depends on driver
bool start true
Start output on operator initialization.
output.dummy
(?id:string, source) -> source
Dummy output for debugging purposes.
source (unlabeled)
string id ""
Force the value of the source ID
output.icecast
(?id:string, ?start:bool, ?host:string, ?port:int, ?user:string, ?password:string, ?genre:string, ?url:string, ?description:string, ?public:bool, ?multicast_ip:string, ?mount:string, ?name:string, ?bitrate:int, ?quality:float, ?freq:int, ?stereo:bool, source) -> source
Send a Vorbis stream to an icecast-compatible server.
source (unlabeled)
int bitrate -1
string description "OCaml Radio!"
int freq 44100
string genre "Misc"
string host "localhost"
string id ""
Force the value of the source ID
string mount "Use [name].ogg"
string multicast_ip "no_multicast"
string name "Use [mount]"
string password "hackme"
int port 8000
bool public true
float quality 0.5
bool start true
Start output threads on operator initialization.
bool stereo true
string url "http://savonet.sf.net"
string user "source"
output.ogg
(?id:string, ?start:bool, ?quality:float, ?bitrate:int, ?freq:int, ?stereo:bool, string, source) -> source
Output the source's stream as an OGG file.
source (unlabeled)
string (unlabeled)
Filename where to output the OGG stream.
int bitrate -1
int freq 44100
string id ""
Force the value of the source ID
float quality 0.5
bool start true
Start output threads on operator initialization.
bool stereo true
output.wav
(?id:string, ?start:bool, string, source) -> source
Output the source's stream to a WAV file.
source (unlabeled)
string (unlabeled)
string id ""
Force the value of the source ID
bool start true
pipe
(?id:string, string, source) -> source
Filter data through an external process. The process should read raw CD format on stdin and write the same on stdout. The command should output one frame for every input frame, and flush its output. Otherwise, liquidsoap will block.
source (unlabeled)
string (unlabeled)
string id ""
Force the value of the source ID
playlist
(?id:string, ?length:float, ?default_duration:float, ?timeout:float, ?mode:string, ?reload:int, ?reload_mode:string, string) -> source
Loop on a playlist of URIs.
string (unlabeled)
URI where to find the playlist
float default_duration 30.
When unknown, assume this duration (in sec.) for files.
string id ""
Force the value of the source ID
float length 60.
How much audio (in sec.) should be downloaded in advance.
string mode "randomize"
normal|random|randomize
int reload 0
Amount of time (in seconds or rounds) before which the playlist is reloaded; 0 means never.
string reload_mode "seconds"
rounds|seconds: unit of the 'reload' parameter
float timeout 20.
Timeout (in sec.) for a single download.
playlist.safe
(?id:string, ?mode:string, ?reload:int, ?reload_mode:string, string) -> source
Loop on a playlist of local files, and never fail. In order to do so, it has to check every file at the loading, so the streamer startup may take a few seconds. To avoid this, use a standard playlist, and put only a few local files in a default safe_playlist in order to ensure the liveness of the streamer.
string (unlabeled)
URI where to find the playlist
string id ""
Force the value of the source ID
string mode "randomize"
normal|random|randomize
int reload 0
Amount of time (in seconds or rounds) before which the playlist is reloaded; 0 means never.
string reload_mode "seconds"
rounds|seconds: unit of the 'reload' parameter
prepend
(?id:string, ?merge:bool, source, (([(string*string)]) -> source)) -> source
Prepend an extra track before every track. Set the metadata 'liq_prepend' to 'false' to inhibit prepending on one track.
([(string*string)]) -> source (unlabeled)
Given the metadata, build the source producing the track to prepend. This source is allowed to fail (produce nothing) if no relevant track is to be appended. However, success must be immediate.
source (unlabeled)
string id ""
Force the value of the source ID
bool merge false
Merge the track with its appended track.
quote
(string) -> string
Escape shell metacharacters.
random
(?id:string, ?track_sensitive:bool, ?before:float, ?transitions:[(source, source) -> source], ?weights:[int], ?strict:bool, [source]) -> source
At the beginning of every track, select a random ready child.
[source] (unlabeled)
float before 0.
EXPERIMENTAL: for track_sensitive switches, trigger transitions before the end of track.
string id ""
Force the value of the source ID
bool strict false
Do not use random but cycle over the uniform distribution.
bool track_sensitive true
Re-select only on end of tracks
[(source, source) -> source] transitions [ ]
Transition functions, padded with (fun (x,y) -> y) functions.
[int] weights [ ]
Weights of the children in the choice.
request
(?indicators:[string], string) -> request
Create a request.
request.dynamic
(?id:string, (() -> request), ?length:float, ?default_duration:float, ?timeout:float) -> source
Play request dynamically created by a given function.
() -> request (unlabeled)
A function generating requests: an initial URI (possibly fake) together with an initial list of alternative indicators
float default_duration 30.
When unknown, assume this duration (in sec.) for files.
string id ""
Force the value of the source ID
float length 60.
How much audio (in sec.) should be downloaded in advance.
float timeout 20.
Timeout (in sec.) for a single download.
request.equeue
(?id:string, ?length:float, ?default_duration:float, ?timeout:float) -> source
Receive URIs from users, and play them. Insertion and deletion possible at any position.
float default_duration 30.
When unknown, assume this duration (in sec.) for files.
string id ""
Force the value of the source ID
float length 60.
How much audio (in sec.) should be downloaded in advance.
float timeout 20.
Timeout (in sec.) for a single download.
request.queue
(?id:string, ?length:float, ?default_duration:float, ?timeout:float) -> source
Receive URIs from users, and play them.
float default_duration 30.
When unknown, assume this duration (in sec.) for files.
string id ""
Force the value of the source ID
float length 60.
How much audio (in sec.) should be downloaded in advance.
float timeout 20.
Timeout (in sec.) for a single download.
rewrite_metadata
(?id:string, [(string*string)], source) -> source
Rewrite metadata on the fly.
source (unlabeled)
[(string*string)] (unlabeled)
List of (target,value) rewriting rules.
string id ""
Force the value of the source ID
sequence
(?id:string, ?merge:bool, [source]) -> source
Play only one track of every successive source, except for the last one which is played as much as available.
[source] (unlabeled)
string id ""
Force the value of the source ID
bool merge false
sine
(?id:string, ?duration:float, int) -> source
Plays a boring sine...
int (unlabeled)
Frequency of the sine
float duration 0.
string id ""
Force the value of the source ID
single
(?id:string, string, ?length:float, ?default_duration:float, ?timeout:float) -> source
Loop on a request. It never fails if the request is static, meaning that it can be fetched once. Typically, http, ftp, say requests are static, and time is not.
string (unlabeled)
URI where to find the file
float default_duration 30.
When unknown, assume this duration (in sec.) for files.
string id ""
Force the value of the source ID
float length 60.
How much audio (in sec.) should be downloaded in advance.
float timeout 20.
Timeout (in sec.) for a single download.
skip_blank
(?id:string, ?threshold:float, ?length:float, source) -> source
Skip track when detecting a blank
source (unlabeled)
string id ""
Force the value of the source ID
float length 20.
Maximum silence length allowed.
float threshold 100.
Intensity threshold under which the stream is considered to be blank.
store_metadata
(?id:string, ?size:int, source) -> source
Keep track of the last N metadata packets in the stream, and make the history available via a server command.
source (unlabeled)
string id ""
Force the value of the source ID
int size 10
Size of the history
strip_blank
(?id:string, ?threshold:float, ?length:float, source) -> source
Strip blanks
source (unlabeled)
string id ""
Force the value of the source ID
float length 20.
Maximum silence length allowed.
float threshold 100.
Intensity threshold under which the stream is considered to be blank.
switch
(?id:string, ?track_sensitive:bool, ?before:float, ?transitions:[(source, source) -> source], ?strict:bool, ?single:[bool], [((() -> bool)*source)]) -> source
At the beginning of a track, select the first source Si such than the temporal predicate Ii is true.
[((() -> bool)*source)] (unlabeled)
Sources Si with the interval Ii when they should be played.
float before 0.
EXPERIMENTAL: for track_sensitive switches, trigger transitions before the end of track.
string id ""
Force the value of the source ID
[bool] single [ ]
Forbid the selection of a branch for two tracks in a row. The empty list stands for [false,...,false].
bool strict false
Unset the operator's ready flag as soon as there is no valid interval, possibly interrupting ongoing tracks.
bool track_sensitive true
Re-select only on end of tracks
[(source, source) -> source] transitions [ ]
Transition functions, padded with (fun (x,y) -> y) functions.
system
(string) -> unit
Shell command call.
time_in_mod
(int, int, int) -> bool
INTERNAL: time_in_mod(a,b,c) checks that the unix time T satisfies a <= T mod c < b