Liquidsoap scripting language reference
The Source / … categories contain all functions that return sources. The Input functions are those which build elementary sources (playing files, synthesizing sound, etc.). The Output functions are those which take a source and register it for being streamed to the outside (file, soundcard, audio server, etc.). The Visualization functions are experimental ones that let you visualize in real-time some aspects of the audio stream. The Sound Processing functions are those which basically work on the source as a continuous audio stream. They would typically be mixers of streams, audio effects or analysis. Finally, Track Processing functions are basically all others, often having a behaviour that depends on or affects the extra information that liquidsoap puts in streams: track limits and metadata.
- Bool
- Configuration
- File
- Getter
- Interaction
- Internet
- Liquidsoap
- List
- Math
- Metadata
- Programming
- Settings
- Source / Audio processing
- Source / Conversion
- Source / FFmpeg filter
- Source / Fade
- Source / Input
- Source / Liquidsoap
- Source / MIDI processing
- Source / Output
- Source / Sound synthesis
- Source / Testing
- Source / Track processing
- Source / Video processing
- Source / Visualization
- String
- System
- Time
- Track / Audio processing
- Track / Conversion
- Track / FFmpeg filter
- Track / Track processing
- Track / Video processing
Bool
!=
Comparison of comparable values.
Type:
('a, 'a) -> bool where 'a is an orderable type
Arguments:
(unlabeled)
(of typeanything that is an orderable type
)(unlabeled)
(of typeanything that is an orderable type
)
<
Comparison of comparable values.
Type:
('a, 'a) -> bool where 'a is an orderable type
Arguments:
(unlabeled)
(of typeanything that is an orderable type
)(unlabeled)
(of typeanything that is an orderable type
)
<=
Comparison of comparable values.
Type:
('a, 'a) -> bool where 'a is an orderable type
Arguments:
(unlabeled)
(of typeanything that is an orderable type
)(unlabeled)
(of typeanything that is an orderable type
)
==
Comparison of comparable values.
Type:
('a, 'a) -> bool where 'a is an orderable type
Arguments:
(unlabeled)
(of typeanything that is an orderable type
)(unlabeled)
(of typeanything that is an orderable type
)
>
Comparison of comparable values.
Type:
('a, 'a) -> bool where 'a is an orderable type
Arguments:
(unlabeled)
(of typeanything that is an orderable type
)(unlabeled)
(of typeanything that is an orderable type
)
>=
Comparison of comparable values.
Type:
('a, 'a) -> bool where 'a is an orderable type
Arguments:
(unlabeled)
(of typeanything that is an orderable type
)(unlabeled)
(of typeanything that is an orderable type
)
and
Return the conjunction of its arguments
Type:
({bool}, {bool}) -> bool
Arguments:
(unlabeled)
(of type{bool}
)(unlabeled)
(of type{bool}
)
not
Returns the negation of its argument.
Type:
(bool) -> bool
Arguments:
(unlabeled)
(of typebool
)
or
Return the disjunction of its arguments
Type:
({bool}, {bool}) -> bool
Arguments:
(unlabeled)
(of type{bool}
)(unlabeled)
(of type{bool}
)
random.bool
Generate a random boolean.
Type:
() -> bool
Configuration
configure.bindir
Liquidsoap’s Internal script directory.
Type:
string
configure.default_font
Liquidsoap’s default font file.
Type:
string
configure.libdir
Liquidsoap’s library directory.
Type:
string
configure.logdir
Liquidsoap’s logging directory.
Type:
string
configure.rundir
Liquidsoap’s PID file directory.
Type:
string
liquidsoap.build_config.architecture
Build-time configuration value for architecture
Type:
string
liquidsoap.build_config.git_sha
Git sha used to compile liquidsoap.
Type:
string?
liquidsoap.build_config.host
Build-time configuration value for host
Type:
string
liquidsoap.build_config.is_release
Is this build a release build?
Type:
bool
liquidsoap.build_config.is_snapshot
Is this build a development snapshot?
Type:
bool
liquidsoap.build_config.native_c_compiler
Build-time configuration value for native_c_compiler
Type:
string
liquidsoap.build_config.native_c_libraries
Build-time configuration value for native_c_libraries
Type:
string
liquidsoap.build_config.ocaml_version
OCaml version used to compile liquidspap.
Type:
string
liquidsoap.build_config.ocamlopt_cflags
Build-time configuration value for ocamlopt_cflags
Type:
string
liquidsoap.build_config.optionals.alsa
Build-time configuration for alsa
Type:
bool
liquidsoap.build_config.optionals.ao
Build-time configuration for ao
Type:
bool
liquidsoap.build_config.optionals.bjack
Build-time configuration for bjack
Type:
bool
liquidsoap.build_config.optionals.camlimages
Build-time configuration for camlimages
Type:
bool
liquidsoap.build_config.optionals.dssi
Build-time configuration for dssi
Type:
bool
liquidsoap.build_config.optionals.faad
Build-time configuration for faad
Type:
bool
liquidsoap.build_config.optionals.fdkaac
Build-time configuration for fdkaac
Type:
bool
liquidsoap.build_config.optionals.ffmpeg
Build-time configuration for ffmpeg
Type:
bool
liquidsoap.build_config.optionals.flac
Build-time configuration for flac
Type:
bool
liquidsoap.build_config.optionals.frei0r
Build-time configuration for frei0r
Type:
bool
liquidsoap.build_config.optionals.gd
Build-time configuration for gd
Type:
bool
liquidsoap.build_config.optionals.graphics
Build-time configuration for graphics
Type:
bool
liquidsoap.build_config.optionals.gstreamer
Build-time configuration for gstreamer
Type:
bool
liquidsoap.build_config.optionals.imagelib
Build-time configuration for imagelib
Type:
bool
liquidsoap.build_config.optionals.inotify
Build-time configuration for inotify
Type:
bool
liquidsoap.build_config.optionals.irc
Build-time configuration for irc
Type:
bool
liquidsoap.build_config.optionals.ladspa
Build-time configuration for ladspa
Type:
bool
liquidsoap.build_config.optionals.lame
Build-time configuration for lame
Type:
bool
liquidsoap.build_config.optionals.lastfm
Build-time configuration for lastfm
Type:
bool
liquidsoap.build_config.optionals.lilv
Build-time configuration for lilv
Type:
bool
liquidsoap.build_config.optionals.lo
Build-time configuration for lo
Type:
bool
liquidsoap.build_config.optionals.mad
Build-time configuration for mad
Type:
bool
liquidsoap.build_config.optionals.magic
Build-time configuration for magic
Type:
bool
liquidsoap.build_config.optionals.mem_usage
Build-time configuration for mem_usage
Type:
bool
liquidsoap.build_config.optionals.memtrace
Build-time configuration for memtrace
Type:
bool
liquidsoap.build_config.optionals.ogg
Build-time configuration for ogg
Type:
bool
liquidsoap.build_config.optionals.opus
Build-time configuration for opus
Type:
bool
liquidsoap.build_config.optionals.osc
Build-time configuration for osc
Type:
bool
liquidsoap.build_config.optionals.oss
Build-time configuration for oss
Type:
bool
liquidsoap.build_config.optionals.portaudio
Build-time configuration for portaudio
Type:
bool
liquidsoap.build_config.optionals.posix_time2
Build-time configuration for posix_time2
Type:
bool
liquidsoap.build_config.optionals.prometheus
Build-time configuration for prometheus
Type:
bool
liquidsoap.build_config.optionals.pulseaudio
Build-time configuration for pulseaudio
Type:
bool
liquidsoap.build_config.optionals.samplerate
Build-time configuration for samplerate
Type:
bool
liquidsoap.build_config.optionals.sdl
Build-time configuration for sdl
Type:
bool
liquidsoap.build_config.optionals.shine
Build-time configuration for shine
Type:
bool
liquidsoap.build_config.optionals.soundtouch
Build-time configuration for soundtouch
Type:
bool
liquidsoap.build_config.optionals.speex
Build-time configuration for speex
Type:
bool
liquidsoap.build_config.optionals.srt
Build-time configuration for srt
Type:
bool
liquidsoap.build_config.optionals.ssl
Build-time configuration for ssl
Type:
bool
liquidsoap.build_config.optionals.taglib
Build-time configuration for taglib
Type:
bool
liquidsoap.build_config.optionals.theora
Build-time configuration for theora
Type:
bool
liquidsoap.build_config.optionals.tls
Build-time configuration for tls
Type:
bool
liquidsoap.build_config.optionals.vorbis
Build-time configuration for vorbis
Type:
bool
liquidsoap.build_config.optionals.winsvc
Build-time configuration for winsvc
Type:
bool
liquidsoap.build_config.optionals.xmlplaylist
Build-time configuration for xmlplaylist
Type:
bool
liquidsoap.build_config.system
Build-time configuration value for system
Type:
string
liquidsoap.build_config.target
Build-time configuration value for target
Type:
string
liquidsoap.version
Liquidsoap version string.
Type:
string
File
file.contents
Read the whole contents of a file.
Type:
(string) -> string
Arguments:
(unlabeled)
(of typestring
)
file.copy
Copy a file. Arguments and implementation follows the POSIX
cp
command line specifications.
Type:
(?recursive : bool, ?force : bool, ?preserve : bool, string, string) -> unit
Arguments:
recursive
(of typebool
, which defaults tofalse
): Copy file hierarchies.force
(of typebool
, which defaults tofalse
): If a file descriptor for a destination file cannot be obtained attempt to unlink the destination file and proceed.preserve
(of typebool
, which defaults tofalse
): Duplicate source files attributes in the destination file.(unlabeled)
(of typestring
): Source(unlabeled)
(of typestring
): Destination
file.digest
Return an MD5 digest for the given file.
Type:
(string) -> string
Arguments:
(unlabeled)
(of typestring
)
file.download
Download file using a regular http.get request. Returns
true
on success.
Type:
(filename : string, ?timeout : float, string) -> bool
Arguments:
filename
(of typestring
): Downloaded filename.timeout
(of typefloat
, which defaults to5.
): Timeout in seconds(unlabeled)
(of typestring
)
file.exists
Returns true if the file or directory exists.
Type:
(string) -> bool
Arguments:
(unlabeled)
(of typestring
)
file.extension
Returns a file’s extension.
Type:
(?dir_sep : string, ?leading_dot : bool, string) -> string
Arguments:
dir_sep
(of typestring
, which defaults to"/"
): Directory separator.leading_dot
(of typebool
, which defaults totrue
): Return extension with a leading dot, e.g..foo
.(unlabeled)
(of typestring
)
file.getter
Getter to the contents of a file.
Type:
(string) -> () -> string
Arguments:
(unlabeled)
(of typestring
): Name of the file from which the contents should be taken.
file.getter.float
Float getter from a file.
Type:
(?default : float, string) -> {float}
Arguments:
default
(of typefloat
, which defaults to0.
): Default value when the file contains invalid data.(unlabeled)
(of typestring
): Name of the file from which the contents should be taken.
file.is_directory
Returns true if the file exists and is a directory.
Type:
(string) -> bool
Arguments:
(unlabeled)
(of typestring
)
file.iterator
Iterate over the contents of a file.
Type:
(string) -> () -> string?
Arguments:
(unlabeled)
(of typestring
)
file.lines
Get the list of lines of a file.
Type:
(string) -> [string]
Arguments:
(unlabeled)
(of typestring
)
file.lines.iterator
Iterate over the lines of a file.
Type:
(string) -> () -> string?
Arguments:
(unlabeled)
(of typestring
)
file.ls
List all the files in a directory.
Type:
(?absolute : bool, ?recursive : bool, ?pattern : string?, ?sorted : bool,
string) -> [string]
Arguments:
absolute
(of typebool
, which defaults tofalse
): Whether to return absolute paths.recursive
(of typebool
, which defaults tofalse
): Whether to look recursively in subdirectories.pattern
(of typestring?
, which defaults tonull
): Pattern that the filenames should match (e.g."*.mp3"
).sorted
(of typebool
, which defaults tofalse
): Return results in a sorted order.(unlabeled)
(of typestring
): Directory to look in.
file.metadata
Read metadata from a file.
Type:
(string, ?exclude : [string]) -> [string * string]
Arguments:
(unlabeled)
(of typestring
): File from which the metadata should be read.exclude
(of type[string]
, which defaults to[]
): Decoders to exclude
file.metadata.ffmpeg
Read metadata from a file using the ffmpeg decoder.
Type:
(string) -> [string * string]
Arguments:
(unlabeled)
(of typestring
): File from which the metadata should be read.
file.metadata.flac
Read metadata from a file using the flac decoder.
Type:
(string) -> [string * string]
Arguments:
(unlabeled)
(of typestring
): File from which the metadata should be read.
file.metadata.flac_native
Read metadata from a file using the flac_native decoder.
Type:
(string) -> [string * string]
Arguments:
(unlabeled)
(of typestring
): File from which the metadata should be read.
file.metadata.id3
Read metadata from a file using the id3 decoder.
Type:
(string) -> [string * string]
Arguments:
(unlabeled)
(of typestring
): File from which the metadata should be read.
file.metadata.id3v1
Read metadata from a file using the id3v1 decoder.
Type:
(string) -> [string * string]
Arguments:
(unlabeled)
(of typestring
): File from which the metadata should be read.
file.metadata.id3v2
Read metadata from a file using the id3v2 decoder.
Type:
(string) -> [string * string]
Arguments:
(unlabeled)
(of typestring
): File from which the metadata should be read.
file.metadata.image
Read metadata from a file using the image decoder.
Type:
(string) -> [string * string]
Arguments:
(unlabeled)
(of typestring
): File from which the metadata should be read.
file.metadata.mp4
Read metadata from a file using the mp4 decoder.
Type:
(string) -> [string * string]
Arguments:
(unlabeled)
(of typestring
): File from which the metadata should be read.
file.metadata.native
Read metadata from a file using the native decoder.
Type:
(string) -> [string * string]
Arguments:
(unlabeled)
(of typestring
): File from which the metadata should be read.
file.metadata.ogg
Read metadata from a file using the ogg decoder.
Type:
(string) -> [string * string]
Arguments:
(unlabeled)
(of typestring
): File from which the metadata should be read.
file.metadata.ogg_native
Read metadata from a file using the ogg_native decoder.
Type:
(string) -> [string * string]
Arguments:
(unlabeled)
(of typestring
): File from which the metadata should be read.
file.metadata.taglib
Read metadata from a file using the taglib decoder.
Type:
(string) -> [string * string]
Arguments:
(unlabeled)
(of typestring
): File from which the metadata should be read.
file.metadata.video-metadata
Read metadata from a file using the video-metadata decoder.
Type:
(string) -> [string * string]
Arguments:
(unlabeled)
(of typestring
): File from which the metadata should be read.
file.mime
Get a file’s mime type. Uses libmagic if enabled, otherwise try to
get the value using the file binary. Returns null()
if no
value can be found.
Type:
(string) -> string?
Arguments:
(unlabeled)
(of typestring
): The file to test
file.mime.cli
Get a file’s mime type by calling the file
command line
binary.
Type:
(string) -> string?
Arguments:
(unlabeled)
(of typestring
)
file.mime.libmagic
Get the MIME type of a file, according to libmagic.
Type:
(string) -> string?
Arguments:
(unlabeled)
(of typestring
)
file.mkdir
Create a directory.
Type:
(?perms : int, string) -> unit
Arguments:
perms
(of typeint
, which defaults to493
): Default file rights if created (default is0o755
).(unlabeled)
(of typestring
)
file.move
Move a file
Type:
(?force : bool, string, string) -> unit
Arguments:
force
(of typebool
, which defaults tofalse
): Do not prompt for confirmation if the destination path exists.(unlabeled)
(of typestring
): Source(unlabeled)
(of typestring
): Destination
file.mtime
Last modification time.
Type:
(string) -> float
Arguments:
(unlabeled)
(of typestring
)
file.open
Open a file.
Type:
(?write : bool, ?create : bool?, ?append : bool, ?non_blocking : bool,
?perms : int, string) -> socket
Arguments:
write
(of typebool
, which defaults tofalse
): Open file for writingcreate
(of typebool?
, which defaults tonull
): Create if nonexistent. Default:false
in read-only mode,true
when writing.append
(of typebool
, which defaults tofalse
): Append data if file exists.non_blocking
(of typebool
, which defaults tofalse
): Open in non-blocking mode.perms
(of typeint
, which defaults to420
): Default file rights if created. Default:0o644
(unlabeled)
(of typestring
)
Methods:
close
(of type() -> unit
): Close the socket.non_blocking
(of type(bool) -> unit
): Set the non-blocking flag on the socketread
(of type((?timeout : float?) -> string) .{wait : (?timeout : float?, (() -> unit)) -> unit}
): Read data from a socket. Reading is done when the function returns an empty string""
.type
(of typestring
): Socket typewrite
(of type((?timeout : float?, string) -> unit) .{wait : (?timeout : float?, (() -> unit)) -> unit}
): Write data to a socket
file.read
Read the content of a file. Returns a function of type
()->string
. File is done reading when function returns
the empty string ""
.
Type:
(string) -> () -> string
Arguments:
(unlabeled)
(of typestring
)
file.remove
Remove a file.
Type:
(string) -> unit
Arguments:
(unlabeled)
(of typestring
)
file.replaygain
Compute the ReplayGain for a file (in dB).
Type:
(?id : string?, ?ratio : float, string) -> float?
Arguments:
id
(of typestring?
, which defaults tonull
)ratio
(of typefloat
, which defaults to50.
): Decoding ratio. A value of50
means try to decode the file50x
faster than real time, if possible. Use this setting to lower CPU peaks when computing replaygain tags.(unlabeled)
(of typestring
): File name.
file.rmdir
Remove a directory and its content.
Type:
(string) -> unit
Arguments:
(unlabeled)
(of typestring
)
file.size
File size in bytes.
Type:
(string) -> int
Arguments:
(unlabeled)
(of typestring
)
file.temp
Return a fresh temporary filename. The temporary file is created empty, with permissions 0o600 (readable and writable only by the file owner).
Type:
(string, string) -> string
Arguments:
(unlabeled)
(of typestring
): File prefix(unlabeled)
(of typestring
): File suffix
file.temp_dir
Return a fresh temporary directory name. The temporary directory is created empty, in the default tmp directory, with permissions 0o700 (readable, writable and listable only by the file owner).
Type:
(string, ?string) -> string
Arguments:
(unlabeled)
(of typestring
): Directory name prefix.(unlabeled)
(of typestring
, which defaults to""
): Directory name suffix.
file.umask
Get the process’s file mode creation mask.
Type:
() -> int
file.umask.set
Set process’s file mode creation mask.
Type:
(int) -> unit
Arguments:
(unlabeled)
(of typeint
)
file.watch
Call a function when a file is modified. Returns unwatch function in
unwatch
method.
Type:
(string, (() -> unit)) -> unit
Arguments:
(unlabeled)
(of typestring
): File to watch.(unlabeled)
(of type() -> unit
): Handler function.
Methods:
unwatch
(of type() -> unit
): Function to remove the watch on the file.
file.which
file.which("progname")
looks for an executable named
“progname” using directories from the PATH environment variable and
returns “” if it could not find one.
Type:
(string) -> string?
Arguments:
(unlabeled)
(of typestring
)
file.write
Write data to a file.
Type:
(data : {string?}, ?perms : int, ?append : bool, string) -> unit
Arguments:
data
(of type{string?}
): Data to write. If passing a callback() -> string?
, the callback must returnnull
or""
when it has finished sending all its data.perms
(of typeint
, which defaults to420
): Default file rights if created. Default:0o644
.append
(of typebool
, which defaults tofalse
): Append data if file exists.(unlabeled)
(of typestring
): Path to write to
file.write.stream
Stream data to a file. Returns a callback to write to the file.
Execute with null
or ""
to signify the end of
the writing operation.
Type:
(?perms : int, ?append : bool, string) -> (string?) -> unit
Arguments:
perms
(of typeint
, which defaults to420
): Default file rights if created. Default:0o644
.append
(of typebool
, which defaults tofalse
): Append data if file exists.(unlabeled)
(of typestring
): Path to write to
medialib
A library to store the metadata of files in given folders and query them. This is useful to generate playlists based on metadata.
Type:
(?id : string?, ?persistency : string?, ?refresh : float?,
?standardize : (([string * string]) -> [string * string]),
?initial_progress : bool, ?directories : [string], ?string?) -> unit
Arguments:
id
(of typestring?
, which defaults tonull
)persistency
(of typestring?
, which defaults tonull
): Store the database in given file, which is reuse to populate the database on next run.refresh
(of typefloat?
, which defaults tonull
): Scan directories for new files every given number of seconds (by default the database is never updated).standardize
(of type([string * string]) -> [string * string]
, which defaults to<fun>
): Function mapped on metadata when indexing. It can be used to change the field names to standard ones, pretreat data, etc.initial_progress
(of typebool
, which defaults totrue
): Show progress of library being indexed at startup.directories
(of type[string]
, which defaults to[]
): Directories to look for files in.(unlabeled)
(of typestring?
, which defaults tonull
): Directory to look for files in.
Methods:
add_directory
(of type(string) -> unit
): Add a new directory which should be scanned.clear
(of type() -> unit
): Remove all known metadata.find
(of type(?case_sensitive : bool, ?artist : string?, ?artist_contains : string?, ?artist_matches : string?, ?album : string?, ?genre : string?, ?title : string?, ?title_contains : string?, ?filename : string?, ?filename_contains : string?, ?filename_matches : string?, ?year : int?, ?year_ge : int?, ?year_lt : int?, ?bpm : int?, ?bpm_ge : int?, ?int?, ?predicate : (([string * string]) -> bool)) -> [string]
): Find files according to conditions on metadata.refresh
(of type() -> unit
): Update metadatas and look for new files.
path.basename
Get the base name of a path, i.e. the name of the file without the
full path. For instance
file.basename("/tmp/folder/bla.mp3")
returns
"bla.mp3"
.
Type:
(string) -> string
Arguments:
(unlabeled)
(of typestring
)
path.concat
Concatenate two paths, using the appropriate directory separator.
Type:
(string, string) -> string
Arguments:
(unlabeled)
(of typestring
)(unlabeled)
(of typestring
)
path.dirname
Get the directory name of a path.
Type:
(string) -> string
Arguments:
(unlabeled)
(of typestring
)
path.home.unrelate
Expand path that start with ‘~’ with the current home directory.
Type:
(string) -> string
Arguments:
(unlabeled)
(of typestring
)
path.remove_extension
Remove the file extension from a path.
Type:
(string) -> string
Arguments:
(unlabeled)
(of typestring
)
playlist.files
Retrieve the list of files contained in a playlist.
Type:
(?id : string?, ?mime_type : string?, ?timeout : float, string) -> [string]
Arguments:
id
(of typestring?
, which defaults tonull
)mime_type
(of typestring?
, which defaults tonull
): Default MIME type for the playlist.null
means automatic detection.timeout
(of typefloat
, which defaults to20.
): Timeout for resolving the playlist(unlabeled)
(of typestring
): Path to the playlist
socket.unix.client
Open a named UNIX socket and connect as a client.
Type:
(?non_blocking : bool, string) -> socket
Arguments:
non_blocking
(of typebool
, which defaults tofalse
): Open in non-blocking mode.(unlabeled)
(of typestring
)
Methods:
close
(of type() -> unit
):read
(of type((?timeout : float?) -> string) .{wait : (?timeout : float?, (() -> unit)) -> unit}
):type
(of typestring
):write
(of type((?timeout : float?, string) -> unit) .{wait : (?timeout : float?, (() -> unit)) -> unit}
):
socket.unix.listen
Open a named socket and wait for a client to connect
Type:
(?non_blocking : bool, string) -> socket
Arguments:
non_blocking
(of typebool
, which defaults tofalse
): Open in non-blocking mode.(unlabeled)
(of typestring
)
Methods:
close
(of type() -> unit
):read
(of type((?timeout : float?) -> string) .{wait : (?timeout : float?, (() -> unit)) -> unit}
):type
(of typestring
):write
(of type((?timeout : float?, string) -> unit) .{wait : (?timeout : float?, (() -> unit)) -> unit}
):
Getter
getter
Create a getter.
Type:
({'a}) -> {'a}
Arguments:
(unlabeled)
(of type{'a}
): Value from which the getter should be created.
getter.case
Return a value depending on whether the getter is constant or not.
Type:
({'a}, (('a) -> 'b), (((() -> 'a)) -> 'b)) -> 'b
Arguments:
(unlabeled)
(of type{'a}
): Getter to inspect.(unlabeled)
(of type('a) -> 'b
)(unlabeled)
(of type((() -> 'a)) -> 'b
)
getter.changes
Detect whether the value of the getter changes.
Type:
({'a}) -> () -> bool where 'a is an orderable type
Arguments:
(unlabeled)
(of type{'a} where 'a is an orderable type
)
getter.float_of_int
Convert an int getter to a float getter.
Type:
({int}) -> {float}
Arguments:
(unlabeled)
(of type{int}
)
getter.function
Construct a function returning the value of a getter.
Type:
({'a}) -> () -> 'a
Arguments:
(unlabeled)
(of type{'a}
)
getter.get
Get the value of a getter.
Type:
({'a}) -> 'a
Arguments:
(unlabeled)
(of type{'a}
)
getter.int_of_float
Convert a float getter to a int getter.
Type:
({float}) -> {int}
Arguments:
(unlabeled)
(of type{float}
)
getter.is_constant
Determine if a getter is a constant.
Type:
({'a}) -> bool
Arguments:
(unlabeled)
(of type{'a}
)
getter.map
Apply a function on a getter.
Type:
((('a) -> 'b), {'a}) -> {'b}
Arguments:
(unlabeled)
(of type('a) -> 'b
): Function to apply.(unlabeled)
(of type{'a}
)
getter.map.memoize
Apply a function on a getter. If the input value has not changed compared to last call, the previous result is returned without computing the function again.
Type:
((('a) -> 'b), {'a}) -> {'b} where 'a is an orderable type
Arguments:
(unlabeled)
(of type('a) -> 'b where 'a is an orderable type
): Function to apply.(unlabeled)
(of type{'a} where 'a is an orderable type
)
getter.merge
Give the latest value among two getters.
Type:
({'a}, {'a}) -> () -> 'a where 'a is an orderable type
Arguments:
(unlabeled)
(of type{'a} where 'a is an orderable type
)(unlabeled)
(of type{'a} where 'a is an orderable type
)
getter.on_change
Execute a function when the value of the getter changes.
Type:
((('a) -> unit), {'a}) -> () -> 'a where 'a is an orderable type
Arguments:
(unlabeled)
(of type('a) -> unit where 'a is an orderable type
)(unlabeled)
(of type{'a} where 'a is an orderable type
)
Interaction
audioscrobbler.nowplaying
Submit a now playing song using the audioscrobbler protocol.
Type:
(user : string, password : string, ?host : string, ?port : int,
?length : bool, [string * string]) -> unit
Arguments:
user
(of typestring
)password
(of typestring
)host
(of typestring
, which defaults to"post.audioscrobbler.com"
): Host for audioscrobbling submissions.port
(of typeint
, which defaults to80
): Port for audioscrobbling submissions.length
(of typebool
, which defaults tofalse
): Try to submit length information. This operation can be CPU intensive. Value forced to true when used with the “user” source type.(unlabeled)
(of type[string * string]
)
audioscrobbler.submit
Submit a played song using the audioscrobbler protocol.
Type:
(?source : string, user : string, password : string, ?host : string,
?port : int, ?length : bool, [string * string]) -> unit
Arguments:
source
(of typestring
, which defaults to"broadcast"
): Source for tracks. Should be one of: “broadcast”, “user”, “recommendation” or “unknown”. Since liquidsoap is intended for radio broadcasting, this is the default. Sources other than user don’t need duration to be set.user
(of typestring
)password
(of typestring
)host
(of typestring
, which defaults to"post.audioscrobbler.com"
): Host for audioscrobbling submissions.port
(of typeint
, which defaults to80
): Port for audioscrobbling submissions.length
(of typebool
, which defaults tofalse
): Try to submit length information. This operation can be CPU intensive. Value forced to true when used with the “user” source type.(unlabeled)
(of type[string * string]
)
icy.update_metadata
Update metata on an icecast mountpoint using the ICY protocol.
Type:
(?host : string, ?port : int, ?user : string, ?transport : http_transport,
?password : string, ?mount : string, ?icy_id : int, ?protocol : string,
?encoding : string?, ?headers : [string * string], [string * string]) ->
unit
Arguments:
host
(of typestring
, which defaults to"localhost"
)port
(of typeint
, which defaults to8000
)user
(of typestring
, which defaults to"source"
)transport
(of typehttp_transport
, which defaults to<unix_transport>
): Http transport. Usehttp.transport.ssl
orhttp.transport.secure_transport
, when available, to enable HTTPS outputpassword
(of typestring
, which defaults to"hackme"
)mount
(of typestring
, which defaults to""
): Source mount point. Mandatory when streaming to icecast.icy_id
(of typeint
, which defaults to1
): Shoutcast source ID. Only supported by Shoutcast v2.protocol
(of typestring
, which defaults to"http"
): Protocol to use. One of: “icy”, “http” or “https”encoding
(of typestring?
, which defaults tonull
): Encoding used to send metadata, default (UTF-8) if null.headers
(of type[string * string]
, which defaults to[("User-Agent", "Liquidsoap/2.2.2 (Unix; OCaml 4.14.1)")]
): Additional headers.(unlabeled)
(of type[string * string]
)
osc.bool
Read from an OSC path.
Type:
(string, bool) -> () -> bool
Arguments:
(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of typebool
): Initial value.
osc.float
Read from an OSC path.
Type:
(string, float) -> () -> float
Arguments:
(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of typefloat
): Initial value.
osc.float_pair
Read from an OSC path.
Type:
(string, (float * float)) -> () -> float * float
Arguments:
(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of typefloat * float
): Initial value.
osc.int
Read from an OSC path.
Type:
(string, int) -> () -> int
Arguments:
(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of typeint
): Initial value.
osc.int_pair
Read from an OSC path.
Type:
(string, (int * int)) -> () -> int * int
Arguments:
(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of typeint * int
): Initial value.
osc.native.float
Read from an OSC path.
Type:
(string, float) -> () -> float
Arguments:
(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of typefloat
): Initial value.
osc.native.float_pair
Read from an OSC path.
Type:
(string, (float * float)) -> () -> float * float
Arguments:
(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of typefloat * float
): Initial value.
osc.native.int
Read from an OSC path.
Type:
(string, int) -> () -> int
Arguments:
(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of typeint
): Initial value.
osc.native.int_pair
Read from an OSC path.
Type:
(string, (int * int)) -> () -> int * int
Arguments:
(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of typeint * int
): Initial value.
osc.native.on_float
Register a callback on OSC messages.
Type:
(string, ((float) -> unit)) -> unit
Arguments:
(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of type(float) -> unit
): Callback function.
osc.native.on_float_pair
Register a callback on OSC messages.
Type:
(string, (((float * float)) -> unit)) -> unit
Arguments:
(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of type((float * float)) -> unit
): Callback function.
osc.native.on_int
Register a callback on OSC messages.
Type:
(string, ((int) -> unit)) -> unit
Arguments:
(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of type(int) -> unit
): Callback function.
osc.native.on_int_pair
Register a callback on OSC messages.
Type:
(string, (((int * int)) -> unit)) -> unit
Arguments:
(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of type((int * int)) -> unit
): Callback function.
osc.native.on_string
Register a callback on OSC messages.
Type:
(string, ((string) -> unit)) -> unit
Arguments:
(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of type(string) -> unit
): Callback function.
osc.native.on_string_pair
Register a callback on OSC messages.
Type:
(string, (((string * string)) -> unit)) -> unit
Arguments:
(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of type((string * string)) -> unit
): Callback function.
osc.native.send_float
Send a value to an OSC client.
Type:
(host : string, port : int, string, float) -> unit
Arguments:
host
(of typestring
): OSC client address.port
(of typeint
): OSC client port.(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of typefloat
): Value to send.
osc.native.send_float_pair
Send a value to an OSC client.
Type:
(host : string, port : int, string, (float * float)) -> unit
Arguments:
host
(of typestring
): OSC client address.port
(of typeint
): OSC client port.(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of typefloat * float
): Value to send.
osc.native.send_int
Send a value to an OSC client.
Type:
(host : string, port : int, string, int) -> unit
Arguments:
host
(of typestring
): OSC client address.port
(of typeint
): OSC client port.(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of typeint
): Value to send.
osc.native.send_int_pair
Send a value to an OSC client.
Type:
(host : string, port : int, string, (int * int)) -> unit
Arguments:
host
(of typestring
): OSC client address.port
(of typeint
): OSC client port.(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of typeint * int
): Value to send.
osc.native.send_string
Send a value to an OSC client.
Type:
(host : string, port : int, string, string) -> unit
Arguments:
host
(of typestring
): OSC client address.port
(of typeint
): OSC client port.(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of typestring
): Value to send.
osc.native.send_string_pair
Send a value to an OSC client.
Type:
(host : string, port : int, string, (string * string)) -> unit
Arguments:
host
(of typestring
): OSC client address.port
(of typeint
): OSC client port.(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of typestring * string
): Value to send.
osc.native.string
Read from an OSC path.
Type:
(string, string) -> () -> string
Arguments:
(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of typestring
): Initial value.
osc.native.string_pair
Read from an OSC path.
Type:
(string, (string * string)) -> () -> string * string
Arguments:
(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of typestring * string
): Initial value.
osc.on_bool
Register a callback on OSC messages.
Type:
(string, ((bool) -> unit)) -> unit
Arguments:
(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of type(bool) -> unit
): Callback function.
osc.on_float
Register a callback on OSC messages.
Type:
(string, ((float) -> unit)) -> unit
Arguments:
(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of type(float) -> unit
): Callback function.
osc.on_float_pair
Register a callback on OSC messages.
Type:
(string, (((float * float)) -> unit)) -> unit
Arguments:
(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of type((float * float)) -> unit
): Callback function.
osc.on_int
Register a callback on OSC messages.
Type:
(string, ((int) -> unit)) -> unit
Arguments:
(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of type(int) -> unit
): Callback function.
osc.on_int_pair
Register a callback on OSC messages.
Type:
(string, (((int * int)) -> unit)) -> unit
Arguments:
(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of type((int * int)) -> unit
): Callback function.
osc.on_string
Register a callback on OSC messages.
Type:
(string, ((string) -> unit)) -> unit
Arguments:
(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of type(string) -> unit
): Callback function.
osc.on_string_pair
Register a callback on OSC messages.
Type:
(string, (((string * string)) -> unit)) -> unit
Arguments:
(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of type((string * string)) -> unit
): Callback function.
osc.send_bool
Send a value to an OSC client.
Type:
(host : string, port : int, string, bool) -> unit
Arguments:
host
(of typestring
): OSC client address.port
(of typeint
): OSC client port.(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of typebool
): Value to send.
osc.send_float
Send a value to an OSC client.
Type:
(host : string, port : int, string, float) -> unit
Arguments:
host
(of typestring
): OSC client address.port
(of typeint
): OSC client port.(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of typefloat
): Value to send.
osc.send_float_pair
Send a value to an OSC client.
Type:
(host : string, port : int, string, (float * float)) -> unit
Arguments:
host
(of typestring
): OSC client address.port
(of typeint
): OSC client port.(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of typefloat * float
): Value to send.
osc.send_int
Send a value to an OSC client.
Type:
(host : string, port : int, string, int) -> unit
Arguments:
host
(of typestring
): OSC client address.port
(of typeint
): OSC client port.(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of typeint
): Value to send.
osc.send_int_pair
Send a value to an OSC client.
Type:
(host : string, port : int, string, (int * int)) -> unit
Arguments:
host
(of typestring
): OSC client address.port
(of typeint
): OSC client port.(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of typeint * int
): Value to send.
osc.send_string
Send a value to an OSC client.
Type:
(host : string, port : int, string, string) -> unit
Arguments:
host
(of typestring
): OSC client address.port
(of typeint
): OSC client port.(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of typestring
): Value to send.
osc.send_string_pair
Send a value to an OSC client.
Type:
(host : string, port : int, string, (string * string)) -> unit
Arguments:
host
(of typestring
): OSC client address.port
(of typeint
): OSC client port.(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of typestring * string
): Value to send.
osc.string
Read from an OSC path.
Type:
(string, string) -> () -> string
Arguments:
(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of typestring
): Initial value.
osc.string_pair
Read from an OSC path.
Type:
(string, (string * string)) -> () -> string * string
Arguments:
(unlabeled)
(of typestring
): OSC path.(unlabeled)
(of typestring * string
): Initial value.
prometheus.counter
Register a prometheus counter
Type:
(help : string, ?namespace : string, ?subsystem : string, labels : [string],
string) -> (label_values : [string]) -> (float) -> unit
Arguments:
help
(of typestring
): Help of the metricnamespace
(of typestring
, which defaults to""
): namespace of the metricsubsystem
(of typestring
, which defaults to""
): subsystem of the metriclabels
(of type[string]
): labels for the metric(unlabeled)
(of typestring
): Name of the metric
prometheus.gauge
Register a prometheus gauge
Type:
(help : string, ?namespace : string, ?subsystem : string, labels : [string],
string) -> (label_values : [string]) -> (float) -> unit
Arguments:
help
(of typestring
): Help of the metricnamespace
(of typestring
, which defaults to""
): namespace of the metricsubsystem
(of typestring
, which defaults to""
): subsystem of the metriclabels
(of type[string]
): labels for the metric(unlabeled)
(of typestring
): Name of the metric
prometheus.summary
Register a prometheus summary
Type:
(help : string, ?namespace : string, ?subsystem : string, labels : [string],
string) -> (label_values : [string]) -> (float) -> unit
Arguments:
help
(of typestring
): Help of the metricnamespace
(of typestring
, which defaults to""
): namespace of the metricsubsystem
(of typestring
, which defaults to""
): subsystem of the metriclabels
(of type[string]
): labels for the metric(unlabeled)
(of typestring
): Name of the metric
server.register
Register a command. You can then execute this function through the server, either telnet or socket.
Type:
(?namespace : string?, ?description : string, ?usage : string?, string,
((string) -> string)) -> unit
Arguments:
namespace
(of typestring?
, which defaults tonull
): Used to group multiple commands for the same functionality. If specified, the command will be namednamespace.command
.description
(of typestring
, which defaults to"No documentation available."
): A description of your command.usage
(of typestring?
, which defaults tonull
): Description of how the command should be used.(unlabeled)
(of typestring
): Name of the command.(unlabeled)
(of type(string) -> string
): Function called when the command is executed. It takes as argument the argument passed on the commandline and returns the message which will be printed on the commandline.
server.telnet
Enable telnet server.
Type:
(?port : int) -> unit
Arguments:
port
(of typeint
, which defaults to1234
): Port on which we should listen.
Internet
harbor.http.middleware.register
Register a new harbor middleware
Type:
(((
{
body : (?timeout : float) -> string,
data : (?timeout : float) -> string,
headers : [string * string],
http_version : string,
method : string,
path : string,
query : [string * string]
}, (() -> string)
.{
content_type : ((string?) -> unit)
.{current : () -> string?
},
data : (({string}) -> unit)
.{current : () -> {string}
},
header : (string, string) -> unit,
headers : (([string * string]) -> unit)
.{current : () -> [string * string]
},
html : ({string}) -> unit,
http_version : ((string) -> unit)
.{current : () -> string
},
json : (?compact : bool, 'C) -> unit,
multipart_form : (?boundary : string?,
[
{
attributes : [string * string],
contents : {string},
headers : ['A * 'B],
name : string
}]) -> unit,
redirect : (?status_code : int, string) -> unit,
send_status : (socket
.{
close : () -> unit,
non_blocking : (bool) -> unit,
read : ((?timeout : float?) -> string)
.{wait : (?timeout : float?, (() -> unit)) -> unit
},
type : string,
write : (string) -> unit
}) -> unit,
status_code : ((int) -> unit)
.{current : () -> int
},
status_message : ((string?) -> unit)
.{current : () -> string?
},
status_sent : () -> bool
},
((
{
body : (?timeout : float) -> string,
data : (?timeout : float) -> string,
headers : [string * string],
http_version : string,
method : string,
path : string,
query : [string * string]
}, (() -> string)
.{
content_type : ((string?) -> unit)
.{current : () -> string?
},
data : (({string}) -> unit)
.{current : () -> {string}
},
header : (string, string) -> unit,
headers : (([string * string]) -> unit)
.{current : () -> [string * string]
},
html : ({string}) -> unit,
http_version : ((string) -> unit)
.{current : () -> string
},
json : (?compact : bool, 'C) -> unit,
multipart_form : (?boundary : string?,
[
{
attributes : [string * string],
contents : {string},
headers : ['A * 'B],
name : string
}]) -> unit,
redirect : (?status_code : int, string) -> unit,
send_status : (socket
.{
close : () -> unit,
non_blocking : (bool) -> unit,
read : ((?timeout : float?) -> string)
.{wait : (?timeout : float?, (() -> unit)) -> unit
},
type : string,
write : (string) -> unit
}) -> unit,
status_code : ((int) -> unit)
.{current : () -> int
},
status_message : ((string?) -> unit)
.{current : () -> string?
},
status_sent : () -> bool
}) -> unit)) -> unit)) -> unit
Arguments:
(unlabeled)
(of type( { body : (?timeout : float) -> string, data : (?timeout : float) -> string, headers : [string * string], http_version : string, method : string, path : string, query : [string * string] }, (() -> string) .{ content_type : ((string?) -> unit) .{current : () -> string? }, data : (({string}) -> unit) .{current : () -> {string} }, header : (string, string) -> unit, headers : (([string * string]) -> unit) .{current : () -> [string * string] }, html : ({string}) -> unit, http_version : ((string) -> unit) .{current : () -> string }, json : (?compact : bool, 'C) -> unit, multipart_form : (?boundary : string?, [ { attributes : [string * string], contents : {string}, headers : ['A * 'B], name : string }]) -> unit, redirect : (?status_code : int, string) -> unit, send_status : (socket .{ close : () -> unit, non_blocking : (bool) -> unit, read : ((?timeout : float?) -> string) .{wait : (?timeout : float?, (() -> unit)) -> unit }, type : string, write : (string) -> unit }) -> unit, status_code : ((int) -> unit) .{current : () -> int }, status_message : ((string?) -> unit) .{current : () -> string? }, status_sent : () -> bool }, (( { body : (?timeout : float) -> string, data : (?timeout : float) -> string, headers : [string * string], http_version : string, method : string, path : string, query : [string * string] }, (() -> string) .{ content_type : ((string?) -> unit) .{current : () -> string? }, data : (({string}) -> unit) .{current : () -> {string} }, header : (string, string) -> unit, headers : (([string * string]) -> unit) .{current : () -> [string * string] }, html : ({string}) -> unit, http_version : ((string) -> unit) .{current : () -> string }, json : (?compact : bool, 'C) -> unit, multipart_form : (?boundary : string?, [ { attributes : [string * string], contents : {string}, headers : ['A * 'B], name : string }]) -> unit, redirect : (?status_code : int, string) -> unit, send_status : (socket .{ close : () -> unit, non_blocking : (bool) -> unit, read : ((?timeout : float?) -> string) .{wait : (?timeout : float?, (() -> unit)) -> unit }, type : string, write : (string) -> unit }) -> unit, status_code : ((int) -> unit) .{current : () -> int }, status_message : ((string?) -> unit) .{current : () -> string? }, status_sent : () -> bool }) -> unit)) -> unit
)
harbor.http.register
Register a HTTP handler on the harbor. The handler function receives
as argument the full requested information and returns the answer sent
to the client, including HTTP headers. This function registers exact
path matches, i.e. "/users"
, "/index.hml"
as
well as fragment matches, i.e. "/user/:id"
,
"/users/:id/collabs/:cid"
, etc. If you need more advanced
matching, use harbor.http.register.regexp
to match regular
expressions. Paths are resolved in the order they are declared and can
override default harbor paths such as metadata handlers. The handler
receives the request details as a record and a response handler. Matched
fragments are reported as part of the response query
parameter. The response handler can be used to fill up details about the
http response, which will be converted into a plain HTTP response string
after the handler returns.
Type:
(?port : int, ?transport : http_transport
.{default_port : int, name : string, protocol : string}, ?method : string,
string,
((
{
body : (?timeout : float) -> string,
data : (?timeout : float) -> string,
headers : [string * string],
http_version : string,
method : string,
path : string,
query : [string * string]
}, (() -> string)
.{
content_type : ((string?) -> unit)
.{current : () -> string?
},
data : (({string}) -> unit)
.{current : () -> {string}
},
header : (string, string) -> unit,
headers : (([string * string]) -> unit)
.{current : () -> [string * string]
},
html : ({string}) -> unit,
http_version : ((string) -> unit)
.{current : () -> string
},
json : (?compact : bool, 'C) -> unit,
multipart_form : (?boundary : string?,
[
{
attributes : [string * string],
contents : {string},
headers : ['A * 'B],
name : string
}]) -> unit,
redirect : (?status_code : int, string) -> unit,
send_status : (socket
.{
close : () -> unit,
non_blocking : (bool) -> unit,
read : ((?timeout : float?) -> string)
.{wait : (?timeout : float?, (() -> unit)) -> unit
},
type : string,
write : (string) -> unit
}) -> unit,
status_code : ((int) -> unit)
.{current : () -> int
},
status_message : ((string?) -> unit)
.{current : () -> string?
},
status_sent : () -> bool
}) -> unit)) -> unit
Arguments:
port
(of typeint
, which defaults to8000
): Port to serve.transport
(of typehttp_transport.{default_port : int, name : string, protocol : string}
, which defaults to<unix_transport>.{name="unix", protocol="http", default_port=80}
): Http transport. Usehttp.transport.ssl
orhttp.transport.secure_transport
, when available, to enable HTTPS outputmethod
(of typestring
, which defaults to"GET"
): Accepted method (“GET” / “POST” / “PUT” / “DELETE” / “HEAD” / “OPTIONS”).(unlabeled)
(of typestring
)(unlabeled)
(of type( { body : (?timeout : float) -> string, data : (?timeout : float) -> string, headers : [string * string], http_version : string, method : string, path : string, query : [string * string] }, (() -> string) .{ content_type : ((string?) -> unit) .{current : () -> string? }, data : (({string}) -> unit) .{current : () -> {string} }, header : (string, string) -> unit, headers : (([string * string]) -> unit) .{current : () -> [string * string] }, html : ({string}) -> unit, http_version : ((string) -> unit) .{current : () -> string }, json : (?compact : bool, 'C) -> unit, multipart_form : (?boundary : string?, [ { attributes : [string * string], contents : {string}, headers : ['A * 'B], name : string }]) -> unit, redirect : (?status_code : int, string) -> unit, send_status : (socket .{ close : () -> unit, non_blocking : (bool) -> unit, read : ((?timeout : float?) -> string) .{wait : (?timeout : float?, (() -> unit)) -> unit }, type : string, write : (string) -> unit }) -> unit, status_code : ((int) -> unit) .{current : () -> int }, status_message : ((string?) -> unit) .{current : () -> string? }, status_sent : () -> bool }) -> unit
)
harbor.http.register.simple
Register a HTTP handler on the harbor. This function offers a simple
API, suitable for quick implementation of HTTP handlers. See
harbor.http.register
for a node/express like alternative
API.
Type:
(?port : int, ?transport : http_transport
.{default_port : int, name : string, protocol : string}, ?method : string,
string,
((
{
body : (?timeout : float) -> string,
data : (?timeout : float) -> string,
headers : [string * string],
http_version : string,
method : string,
path : string,
query : [string * string],
socket : socket
.{
close : () -> unit,
non_blocking : (bool) -> unit,
read : ((?timeout : float?) -> string)
.{wait : (?timeout : float?, (() -> unit)) -> unit
},
type : string,
write : ((?timeout : float?, string) -> unit)
.{wait : (?timeout : float?, (() -> unit)) -> unit
}
}
}) -> {string}?)) -> unit
Arguments:
port
(of typeint
, which defaults to8000
): Port to serve.transport
(of typehttp_transport.{default_port : int, name : string, protocol : string}
, which defaults to<unix_transport>.{name="unix", protocol="http", default_port=80}
): Http transport. Usehttp.transport.ssl
orhttp.transport.secure_transport
, when available, to enable HTTPS outputmethod
(of typestring
, which defaults to"GET"
): Accepted method (“GET” / “POST” / “PUT” / “DELETE” / “HEAD” / “OPTIONS”).(unlabeled)
(of typestring
)(unlabeled)
(of type( { body : (?timeout : float) -> string, data : (?timeout : float) -> string, headers : [string * string], http_version : string, method : string, path : string, query : [string * string], socket : socket .{ close : () -> unit, non_blocking : (bool) -> unit, read : ((?timeout : float?) -> string) .{wait : (?timeout : float?, (() -> unit)) -> unit }, type : string, write : ((?timeout : float?, string) -> unit) .{wait : (?timeout : float?, (() -> unit)) -> unit } } }) -> {string}?
)
harbor.http.register.simple.regexp
Register a HTTP handler on the harbor with a generic regexp
path
. This function offers a simple API, suitable for quick
implementation of HTTP handlers. See harbor.http.register
for a node/express like alternative API.
Type:
(?port : int, ?transport : http_transport
.{default_port : int, name : string, protocol : string}, ?method : string,
regexp,
((
{
data : (?timeout : float) -> string,
headers : [string * string],
http_version : string,
method : string,
path : string,
query : [string * string],
socket : socket
.{
close : () -> unit,
non_blocking : (bool) -> unit,
read : ((?timeout : float?) -> string)
.{wait : (?timeout : float?, (() -> unit)) -> unit
},
type : string,
write : ((?timeout : float?, string) -> unit)
.{wait : (?timeout : float?, (() -> unit)) -> unit
}
}
}) -> {string}?)) -> unit
Arguments:
port
(of typeint
, which defaults to8000
): Port to serve.transport
(of typehttp_transport.{default_port : int, name : string, protocol : string}
, which defaults to<unix_transport>.{name="unix", protocol="http", default_port=80}
): Http transport. Usehttp.transport.ssl
orhttp.transport.secure_transport
, when available, to enable HTTPS outputmethod
(of typestring
, which defaults to"GET"
): Accepted method (“GET” / “POST” / “PUT” / “DELETE” / “HEAD” / “OPTIONS”).(unlabeled)
(of typeregexp
)(unlabeled)
(of type( { data : (?timeout : float) -> string, headers : [string * string], http_version : string, method : string, path : string, query : [string * string], socket : socket .{ close : () -> unit, non_blocking : (bool) -> unit, read : ((?timeout : float?) -> string) .{wait : (?timeout : float?, (() -> unit)) -> unit }, type : string, write : ((?timeout : float?, string) -> unit) .{wait : (?timeout : float?, (() -> unit)) -> unit } } }) -> {string}?
)
harbor.http.static
Serve a static path.
Type:
(?transport : http_transport
.{default_port : int, name : string, protocol : string}, ?port : int,
?path : string, ?browse : bool, ?content_type : ((string) -> string?),
?headers : [string * string], string) -> unit
Arguments:
transport
(of typehttp_transport.{default_port : int, name : string, protocol : string}
, which defaults to<unix_transport>.{default_port=80, protocol="http", name="unix"}
): Http transport. Usehttp.transport.ssl
or http.transport.secure_transport`, when available, to enable HTTPS outputport
(of typeint
, which defaults to8000
): Port for incoming harbor (http) connections.path
(of typestring
, which defaults to"/"
): Base path.browse
(of typebool
, which defaults tofalse
): List files in directories.content_type
(of type(string) -> string?
, which defaults to<fun>.{libmagic=<fun>, cli=<fun>}
): Callback to specify Content-Type on a per file basis. Default: file.mime if compiled or file CLI if present.headers
(of type[string * string]
, which defaults to[("Access-Control-Allow-Origin", "*")]
): Default response headers.(unlabeled)
(of typestring
): Local path to be served.
harbor.remove
Remove a registered handler on the harbor.
Type:
(?port : int, ?method : string, regexp) -> unit
Arguments:
port
(of typeint
, which defaults to8000
): Port to serve.method
(of typestring
, which defaults to"GET"
): Method served.(unlabeled)
(of typeregexp
): URI served.
host.of_internet_address
Find a host by internet address
Type:
(internet_address) ->
{
addresses : [internet_address.{is_ipv6 : bool, to_string : () -> string}],
aliases : [string],
domain : socket_domain,
name : string}?
Arguments:
(unlabeled)
(of typeinternet_address
)
host.of_name
Find a host by name
Type:
(string) ->
{
addresses : [internet_address.{is_ipv6 : bool, to_string : () -> string}],
aliases : [string],
domain : socket_domain,
name : string}?
Arguments:
(unlabeled)
(of typestring
): hostname
http.delete
Perform a full http DELETE request.
Type:
(?headers : [string * string], ?http_version : string?, ?redirect : bool,
?timeout : float?, string) -> unit
Arguments:
headers
(of type[string * string]
, which defaults to[]
): Additional headers.http_version
(of typestring?
, which defaults tonull
): Http request version.redirect
(of typebool
, which defaults totrue
): Perform redirections if needed.timeout
(of typefloat?
, which defaults to10.
): Timeout for network operations in seconds.(unlabeled)
(of typestring
): Requested URL, e.g."http://www.liquidsoap.info/"
.
Methods:
headers
(of type[string * string]
): HTTP headers.http_version
(of typestring
): Version of the HTTP protocol.status_code
(of typeint
): Status code.status_message
(of typestring
): Status message.
http.delete.stream
Perform a full http DELETE request.
Type:
(?headers : [string * string], ?http_version : string?, ?redirect : bool,
?timeout : float?, string, on_body_data : ((string?) -> unit)) -> unit
Arguments:
headers
(of type[string * string]
, which defaults to[]
): Additional headers.http_version
(of typestring?
, which defaults tonull
): Http request version.redirect
(of typebool
, which defaults totrue
): Perform redirections if needed.timeout
(of typefloat?
, which defaults to10.
): Timeout for network operations in seconds.(unlabeled)
(of typestring
): Requested URL, e.g."http://www.liquidsoap.info/"
.on_body_data
(of type(string?) -> unit
): function called when receiving response body data.null
or""
means that all the data has been passed.
Methods:
headers
(of type[string * string]
): HTTP headers.http_version
(of typestring
): Version of the HTTP protocol.status_code
(of typeint
): Status code.status_message
(of typestring
): Status message.
http.get
Perform a full http GET request.
Type:
(?headers : [string * string], ?http_version : string?, ?redirect : bool,
?timeout : float?, string) -> string
Arguments:
headers
(of type[string * string]
, which defaults to[]
): Additional headers.http_version
(of typestring?
, which defaults tonull
): Http request version.redirect
(of typebool
, which defaults totrue
): Perform redirections if needed.timeout
(of typefloat?
, which defaults to10.
): Timeout for network operations in seconds.(unlabeled)
(of typestring
): Requested URL, e.g."http://www.liquidsoap.info/"
.
Methods:
headers
(of type[string * string]
): HTTP headers.http_version
(of typestring
): Version of the HTTP protocol.status_code
(of typeint
): Status code.status_message
(of typestring
): Status message.
http.get.stream
Perform a full http GET request.
Type:
(?headers : [string * string], ?http_version : string?, ?redirect : bool,
?timeout : float?, string, on_body_data : ((string?) -> unit)) -> unit
Arguments:
headers
(of type[string * string]
, which defaults to[]
): Additional headers.http_version
(of typestring?
, which defaults tonull
): Http request version.redirect
(of typebool
, which defaults totrue
): Perform redirections if needed.timeout
(of typefloat?
, which defaults to10.
): Timeout for network operations in seconds.(unlabeled)
(of typestring
): Requested URL, e.g."http://www.liquidsoap.info/"
.on_body_data
(of type(string?) -> unit
): function called when receiving response body data.null
or""
means that all the data has been passed.
Methods:
headers
(of type[string * string]
): HTTP headers.http_version
(of typestring
): Version of the HTTP protocol.status_code
(of typeint
): Status code.status_message
(of typestring
): Status message.
http.head
Perform a full http HEAD request.
Type:
(?headers : [string * string], ?http_version : string?, ?redirect : bool,
?timeout : float?, string) -> unit
Arguments:
headers
(of type[string * string]
, which defaults to[]
): Additional headers.http_version
(of typestring?
, which defaults tonull
): Http request version.redirect
(of typebool
, which defaults totrue
): Perform redirections if needed.timeout
(of typefloat?
, which defaults to10.
): Timeout for network operations in seconds.(unlabeled)
(of typestring
): Requested URL, e.g."http://www.liquidsoap.info/"
.
Methods:
headers
(of type[string * string]
): HTTP headers.http_version
(of typestring
): Version of the HTTP protocol.status_code
(of typeint
): Status code.status_message
(of typestring
): Status message.
http.head.stream
Perform a full http HEAD request.
Type:
(?headers : [string * string], ?http_version : string?, ?redirect : bool,
?timeout : float?, string, on_body_data : ((string?) -> unit)) -> unit
Arguments:
headers
(of type[string * string]
, which defaults to[]
): Additional headers.http_version
(of typestring?
, which defaults tonull
): Http request version.redirect
(of typebool
, which defaults totrue
): Perform redirections if needed.timeout
(of typefloat?
, which defaults to10.
): Timeout for network operations in seconds.(unlabeled)
(of typestring
): Requested URL, e.g."http://www.liquidsoap.info/"
.on_body_data
(of type(string?) -> unit
): function called when receiving response body data.null
or""
means that all the data has been passed.
Methods:
headers
(of type[string * string]
): HTTP headers.http_version
(of typestring
): Version of the HTTP protocol.status_code
(of typeint
): Status code.status_message
(of typestring
): Status message.
http.headers.content_disposition
Extract the content-disposition header
Type:
([string * string]) ->
{args : [string * string?], filename? : string, name? : string, type : string
}?
Arguments:
(unlabeled)
(of type[string * string]
)
http.headers.content_type
Extract the content-type header
Type:
([string * string?]) -> {args : [string * string], mime : string}?
Arguments:
(unlabeled)
(of type[string * string?]
)
http.headers.extname
Try to get a filename from a request’s headers.
Type:
([string * string]) -> string?
Arguments:
(unlabeled)
(of type[string * string]
)
http.multipart_form_data
Prepare a list of data to be sent as multipart form data.
Type:
(?boundary : string?,
[
{
attributes : [string * string],
contents : {string},
headers : ['a * 'b],
name : string
}]) -> unit
Arguments:
boundary
(of typestring?
, which defaults tonull
): Specify boundary to use for multipart/form-data.(unlabeled)
(of type[ { attributes : [string * string], contents : {string}, headers : ['a * 'b], name : string }]
): data to insert
Methods:
boundary
(of typestring
):contents
(of type{string}
):
http.post
Perform a full http POST request.
Type:
(?data : {string}, ?headers : [string * string], ?http_version : string?,
?redirect : bool, ?timeout : float?, string) -> string
Arguments:
data
(of type{string}
, which defaults to""
): POST data. Use astring
getter to stream data and return""
when all data has been passed.headers
(of type[string * string]
, which defaults to[]
): Additional headers.http_version
(of typestring?
, which defaults tonull
): Http request version.redirect
(of typebool
, which defaults totrue
): Perform redirections if needed.timeout
(of typefloat?
, which defaults to10.
): Timeout for network operations in seconds.(unlabeled)
(of typestring
): Requested URL, e.g."http://www.liquidsoap.info/"
.
Methods:
headers
(of type[string * string]
): HTTP headers.http_version
(of typestring
): Version of the HTTP protocol.status_code
(of typeint
): Status code.status_message
(of typestring
): Status message.
http.post.file
Send a file via POST request encoded in multipart/form-data. The
contents can either be directly specified (with the
contents
argument) or taken from a file (with the
file
argument).
Type:
(?name : string, ?content_type : string?, ?headers : [string * string],
?boundary : string?, ?filename : string?, ?file : string?,
?contents : {string}?, ?timeout : float?, ?redirect : bool, string) ->
string
Arguments:
name
(of typestring
, which defaults to"file"
): Name of the field fieldcontent_type
(of typestring?
, which defaults tonull
): Content-type (mime) for the file.headers
(of type[string * string]
, which defaults to[]
): Additional headers.boundary
(of typestring?
, which defaults tonull
): Specify boundary to use for multipart/form-data.filename
(of typestring?
, which defaults tonull
): File name sent in the request.file
(of typestring?
, which defaults tonull
): File whose contents is to be sent in the request.contents
(of type{string}?
, which defaults tonull
): Contents of the file sent in the request.timeout
(of typefloat?
, which defaults tonull
): Timeout in seconds.redirect
(of typebool
, which defaults totrue
): Follow reidrections.(unlabeled)
(of typestring
): URL to post to.
Methods:
headers
(of type[string * string]
): HTTP headers.http_version
(of typestring
): Version of the HTTP protocol.status_code
(of typeint
): Status code.status_message
(of typestring
): Status message.
http.post.stream
Perform a full http POST request.
Type:
(?data : {string}, ?headers : [string * string], ?http_version : string?,
?redirect : bool, ?timeout : float?, string,
on_body_data : ((string?) -> unit)) -> unit
Arguments:
data
(of type{string}
, which defaults to""
): POST data. Use astring
getter to stream data and return""
when all data has been passed.headers
(of type[string * string]
, which defaults to[]
): Additional headers.http_version
(of typestring?
, which defaults tonull
): Http request version.redirect
(of typebool
, which defaults totrue
): Perform redirections if needed.timeout
(of typefloat?
, which defaults to10.
): Timeout for network operations in seconds.(unlabeled)
(of typestring
): Requested URL, e.g."http://www.liquidsoap.info/"
.on_body_data
(of type(string?) -> unit
): function called when receiving response body data.null
or""
means that all the data has been passed.
Methods:
headers
(of type[string * string]
): HTTP headers.http_version
(of typestring
): Version of the HTTP protocol.status_code
(of typeint
): Status code.status_message
(of typestring
): Status message.
http.put
Perform a full http PUT request.
Type:
(?data : {string}, ?headers : [string * string], ?http_version : string?,
?redirect : bool, ?timeout : float?, string) -> string
Arguments:
data
(of type{string}
, which defaults to""
): POST data. Use astring
getter to stream data and return""
when all data has been passed.headers
(of type[string * string]
, which defaults to[]
): Additional headers.http_version
(of typestring?
, which defaults tonull
): Http request version.redirect
(of typebool
, which defaults totrue
): Perform redirections if needed.timeout
(of typefloat?
, which defaults to10.
): Timeout for network operations in seconds.(unlabeled)
(of typestring
): Requested URL, e.g."http://www.liquidsoap.info/"
.
Methods:
headers
(of type[string * string]
): HTTP headers.http_version
(of typestring
): Version of the HTTP protocol.status_code
(of typeint
): Status code.status_message
(of typestring
): Status message.
http.put.file
Send a file via PUT request encoded in multipart/form-data. The
contents can either be directly specified (with the
contents
argument) or taken from a file (with the
file
argument).
Type:
(?name : string, ?content_type : string?, ?headers : [string * string],
?boundary : string?, ?filename : string?, ?file : string?,
?contents : {string}?, ?timeout : float?, ?redirect : bool, string) ->
string
Arguments:
name
(of typestring
, which defaults to"file"
): Name of the field fieldcontent_type
(of typestring?
, which defaults tonull
): Content-type (mime) for the file.headers
(of type[string * string]
, which defaults to[]
): Additional headers.boundary
(of typestring?
, which defaults tonull
): Specify boundary to use for multipart/form-data.filename
(of typestring?
, which defaults tonull
): File name sent in the request.file
(of typestring?
, which defaults tonull
): File whose contents is to be sent in the request.contents
(of type{string}?
, which defaults tonull
): Contents of the file sent in the request.timeout
(of typefloat?
, which defaults tonull
): Timeout in seconds.redirect
(of typebool
, which defaults totrue
): Follow reidrections.(unlabeled)
(of typestring
): URL to put to.
Methods:
headers
(of type[string * string]
): HTTP headers.http_version
(of typestring
): Version of the HTTP protocol.status_code
(of typeint
): Status code.status_message
(of typestring
): Status message.
http.put.stream
Perform a full http PUT request.
Type:
(?data : {string}, ?headers : [string * string], ?http_version : string?,
?redirect : bool, ?timeout : float?, string,
on_body_data : ((string?) -> unit)) -> unit
Arguments:
data
(of type{string}
, which defaults to""
): POST data. Use astring
getter to stream data and return""
when all data has been passed.headers
(of type[string * string]
, which defaults to[]
): Additional headers.http_version
(of typestring?
, which defaults tonull
): Http request version.redirect
(of typebool
, which defaults totrue
): Perform redirections if needed.timeout
(of typefloat?
, which defaults to10.
): Timeout for network operations in seconds.(unlabeled)
(of typestring
): Requested URL, e.g."http://www.liquidsoap.info/"
.on_body_data
(of type(string?) -> unit
): function called when receiving response body data.null
or""
means that all the data has been passed.
Methods:
headers
(of type[string * string]
): HTTP headers.http_version
(of typestring
): Version of the HTTP protocol.status_code
(of typeint
): Status code.status_message
(of typestring
): Status message.
http.response
Initiate a response handler with pre-filled values.
Type:
(?http_version : string, ?status_code : int?, ?status_message : string?,
?headers : [string * string], ?content_type : string?, ?data : {string}) ->
() -> string
Arguments:
http_version
(of typestring
, which defaults to"1.1"
)status_code
(of typeint?
, which defaults tonull
)status_message
(of typestring?
, which defaults tonull
)headers
(of type[string * string]
, which defaults to[]
)content_type
(of typestring?
, which defaults tonull
)data
(of type{string}
, which defaults to""
)
Methods:
content_type
(of type((string?) -> unit).{current : () -> string?}
): Set"Content-Type"
headerdata
(of type(({string}) -> unit).{current : () -> {string}}
): Set response data.header
(of type(string, string) -> unit
): Set a single header on the responseheaders
(of type(([string * string]) -> unit).{current : () -> [string * string]}
): Replace response headers.html
(of type({string}) -> unit
): Set content-type to html and data to argument valuehttp_version
(of type((string) -> unit).{current : () -> string}
): Set http protocol versionjson
(of type(?compact : bool, 'A) -> unit
): Set content-type to json and data tojson.stringify
of the argumentmultipart_form
(of type(?boundary : string?, [ { attributes : [string * string], contents : {string}, headers : ['A * 'B], name : string }]) -> unit
):redirect
(of type(?status_code : int, string) -> unit
): Setstatus_code
andLocation:
header for a HTTP redirect responsesend_status
(of type('A.{write : (string) -> unit}) -> unit
):status_code
(of type((int) -> unit).{current : () -> int}
): Set response status codestatus_message
(of type((string?) -> unit).{current : () -> string?}
): Set response status messagestatus_sent
(of type() -> bool
):
http.transport.ssl
Https transport using libssl
Type:
(?read_timeout : float?, ?write_timeout : float?, ?password : string?,
?min_protocol : string?, ?max_protocol : string?, ?certificate : string?,
?key : string?) -> http_transport
Arguments:
read_timeout
(of typefloat?
, which defaults tonull
): Read timeoutwrite_timeout
(of typefloat?
, which defaults tonull
): Write timeoutpassword
(of typestring?
, which defaults tonull
): SSL certificate passwordmin_protocol
(of typestring?
, which defaults tonull
): Minimal accepted SSL protocol. One of, from least recent to most recent:"ssl.3"
,"tls.1"
,"tls.1.1"
,"tls.1.2"
or"tls.1.3"
. The most recent available protocol between client and server is negotiated when initiating communication between minimal and maximal protocol version. All protocols up to"tls.1.2"
and above are now deprecated so you might want to set this value to one of those two. Default to lowest support protocol if not set.max_protocol
(of typestring?
, which defaults tonull
): Maximal accepted SSL protocol. One of, from least recent to most recent:"ssl.3"
,"tls.1"
,"tls.1.1"
,"tls.1.2"
or"tls.1.3"
. The most recent available protocol between client and server is negotiated when initiating communication between minimal and maximal protocol version. Defaults to highest protocol supported if not set.certificate
(of typestring?
, which defaults tonull
): Path to certificate file. Required in server mode, e.g.input.harbor
, etc. If passed in client mode, certificate is added to the list of valid certificates.key
(of typestring?
, which defaults tonull
): Path to certificate private key. Required in server mode, e.g.input.harbor
, etc.
Methods:
default_port
(of typeint
): Transport default portname
(of typestring
): Transport nameprotocol
(of typestring
): Transport protocol
http.transport.tls
Https transport using libtls
Type:
(?read_timeout : float?, ?write_timeout : float?, ?certificate : string?,
?key : string?) -> http_transport
Arguments:
read_timeout
(of typefloat?
, which defaults tonull
): Read timeoutwrite_timeout
(of typefloat?
, which defaults tonull
): Write timeoutcertificate
(of typestring?
, which defaults tonull
): Path to certificate file. Required in server mode, e.g.input.harbor
, etc. If passed in client mode, certificate is added to the list of valid certificates.key
(of typestring?
, which defaults tonull
): Path to certificate private key. Required in server mode, e.g.input.harbor
, etc. Unused in client mode.
Methods:
default_port
(of typeint
): Transport default portname
(of typestring
): Transport nameprotocol
(of typestring
): Transport protocol
http.transport.unix
Http unencrypted transport
Type:
http_transport.{default_port : int, name : string, protocol : string}
http.user_agent
Default user-agent
Type:
string
socket.address.internet_address
Create a socket address for a internet address.
Type:
(internet_address.{is_ipv6 : bool, to_string : () -> string}, int) ->
socket_address
Arguments:
(unlabeled)
(of typeinternet_address.{is_ipv6 : bool, to_string : () -> string}
): Internet address.(unlabeled)
(of typeint
): port
Methods:
domain
(of typesocket_domain
): Socket domaininternet_address
(of typeinternet_address.{is_ipv6 : bool, to_string : () -> string}
): Internet addressport
(of typeint
): Port
socket.address.unix
Create a socket address for a unix file socket.
Type:
(string) -> socket_address
Arguments:
(unlabeled)
(of typestring
): Unix socket path
Methods:
domain
(of typesocket_domain
): Socket domainpath
(of typestring
): Unix socket path
socket.domain.inet
Inet socket domain
Type:
socket_domain
socket.domain.inet6
Inet6 socket domain
Type:
socket_domain
socket.domain.unix
Unix socket domain
Type:
socket_domain
socket.internet_address
Return an internet address from its string representation.
Type:
(string) -> internet_address
Arguments:
(unlabeled)
(of typestring
): Socket internet address.
Methods:
is_ipv6
(of typebool
): Is the internet address a ipv6 address?to_string
(of type() -> string
): String representation of the internet address
socket.internet_address.any
A special IPv4 address, for use only with socket.bind
,
representing all the Internet addresses that the host machine
possesses.
Type:
internet_address.{is_ipv6 : bool, to_string : () -> string}
socket.internet_address.ipv6.any
A special IPv6 address, for use only with socket.bind
,
representing all the Internet addresses that the host machine
possesses.
Type:
internet_address.{is_ipv6 : bool, to_string : () -> string}
socket.internet_address.ipv6.loopback
A special IPv6 address representing the host machine
(::1
).
Type:
internet_address.{is_ipv6 : bool, to_string : () -> string}
socket.internet_address.loopback
A special IPv4 address representing the host machine
(127.0.0.1
).
Type:
internet_address.{is_ipv6 : bool, to_string : () -> string}
socket.pair
Create a pair of sockets connected together.
Type:
(?domain : socket_domain, ?type : socket_type, ?protocol : int) -> socket
Arguments:
domain
(of typesocket_domain
, which defaults tosocket.domain.inet
): Socket domain.type
(of typesocket_type
, which defaults tosocket.type.stream
): Socket typeprotocol
(of typeint
, which defaults to0
): Protocol type.0
selects the default protocol for that kind of sockets.
Methods:
close
(of type() -> unit
): Close the socket.non_blocking
(of type(bool) -> unit
): Set the non-blocking flag on the socketread
(of type((?timeout : float?) -> string) .{wait : (?timeout : float?, (() -> unit)) -> unit}
): Read data from a socket. Reading is done when the function returns an empty string""
.type
(of typestring
): Socket typewrite
(of type((?timeout : float?, string) -> unit) .{wait : (?timeout : float?, (() -> unit)) -> unit}
): Write data to a socket
socket.type.dgram
Dgram socket type
Type:
socket_type
socket.type.raw
Raw socket type
Type:
socket_type
socket.type.stream
Stream socket type
Type:
socket_type
socket.unix
Create a unix socket.
Type:
(?domain : socket_domain, ?type : socket_type, ?protocol : int) -> socket
Arguments:
domain
(of typesocket_domain
, which defaults tosocket.domain.inet
): Socket domain.type
(of typesocket_type
, which defaults tosocket.type.stream
): Socket typeprotocol
(of typeint
, which defaults to0
): Protocol type.0
selects the default protocol for that kind of sockets.
Methods:
accept
(of type() -> socket .{ close : () -> unit, non_blocking : (bool) -> unit, read : ((?timeout : float?) -> string) .{wait : (?timeout : float?, (() -> unit)) -> unit }, type : string, write : ((?timeout : float?, string) -> unit) .{wait : (?timeout : float?, (() -> unit)) -> unit } } * socket_address
): Accept connections on the given socket. The returned socket is a socket connected to the client; the returned address is the address of the connecting client.bind
(of type(socket_address) -> unit
): Bind a socket to an address.close
(of type() -> unit
): Close the socket.connect
(of type(socket_address) -> unit
): Connect a socket to an address.listen
(of type(int) -> unit
): Set up a socket for receiving connection requests. The integer argument is the maximal number of pending requests.non_blocking
(of type(bool) -> unit
): Set the non-blocking flag on the socketread
(of type((?timeout : float?) -> string) .{wait : (?timeout : float?, (() -> unit)) -> unit}
): Read data from a socket. Reading is done when the function returns an empty string""
.type
(of typestring
): Socket typewrite
(of type((?timeout : float?, string) -> unit) .{wait : (?timeout : float?, (() -> unit)) -> unit}
): Write data to a socket
Liquidsoap
clock
Assign a new clock to the given source (and to other time-dependent sources) and return the source. It is a conveniency wrapper around clock.assign_new(), allowing more concise scripts in some cases.
Type:
(?sync : string, ?id : string?, source('a)) -> source('a)
Arguments:
sync
(of typestring
, which defaults to"auto"
): Synchronization mode. One of:"auto"
,"cpu"
, or"none"
. Defaults to"auto"
, which synchronizes with the CPU clock if none of the active sources are attached to their own clock (e.g. ALSA input, etc)."cpu"
always synchronizes with the CPU clock."none"
removes all synchronization control.id
(of typestring?
, which defaults tonull
)(unlabeled)
(of typesource('a)
)
clock.assign_new
Create a new clock and assign it to a list of sources.
Type:
(?id : string?,
?on_error : ((error
.{
kind : string,
message : string,
trace : [
{
position_end :
{
character_offset : int,
filename : string,
line_number : int
},
position_start :
{
character_offset : int,
filename : string,
line_number : int
},
to_string : (?prefix : string) -> string
}]
}) -> unit)?,
?sync : string, [source('a)]) -> unit
Arguments:
id
(of typestring?
, which defaults tonull
): Identifier for the new clock. The default empty string means that the identifier of the first source will be used.on_error
(of type((error .{ kind : string, message : string, trace : [ { position_end : {character_offset : int, filename : string, line_number : int }, position_start : {character_offset : int, filename : string, line_number : int }, to_string : (?prefix : string) -> string }] }) -> unit)?
, which defaults tonull
): Error callback executed when a streaming error occurs. When passed, all streaming errors are silenced. Intended mostly for debugging purposes.sync
(of typestring
, which defaults to"auto"
): Synchronization mode. One of:"auto"
,"cpu"
, or"none"
. Defaults to"auto"
, which synchronizes with the CPU clock if none of the active sources are attached to their own clock (e.g. ALSA input, etc)."cpu"
always synchronizes with the CPU clock."none"
removes all synchronization control.(unlabeled)
(of type[source('a)]
): List of sources to which the new clock will be assigned.
clock.log
Create a log of clock times for all the clocks initially present. The log is in a simple format which you can directly use with gnuplot.
Type:
(?delay : float, ?every : float, string) -> unit
Arguments:
delay
(of typefloat
, which defaults to0.
): Delay before setting up the clock logger. This should be used to ensure that the logger starts only after the clocks are created.every
(of typefloat
, which defaults to1.
): Polling interval.(unlabeled)
(of typestring
): Path of the log file.
clock.status
Get the current time (in clock ticks) for all allocated clocks.
Type:
() -> [string * int]
clock.status.seconds
Get the current time in seconds for all allocated clocks.
Type:
() -> [string * float]
clock.unify
Enforce that a list of sources all belong to the same clock.
Type:
([source('a)]) -> unit
Arguments:
(unlabeled)
(of type[source('a)]
)
decoder.add
Register an external decoder. The encoder should output in WAV format to his standard output (stdout) and read data from its standard input (stdin).
Type:
(name : string, description : string, ?mimes : [string],
?file_extensions : [string], ?priority : int, test : ((string) -> int),
string) -> unit
Arguments:
name
(of typestring
): Format/decoder’s name.description
(of typestring
): Description of the decoder.mimes
(of type[string]
, which defaults to[]
): List of mime types supported by this decoder. Empty means any mime type should be accepted.file_extensions
(of type[string]
, which defaults to[]
): List of file extensions. Empty means any file extension should be accepted.priority
(of typeint
, which defaults to1
): Decoder prioritytest
(of type(string) -> int
): Function used to determine if a file should be decoded by the decoder. Returned values are: 0: no decodable audio, -1: decodable audio but number of audio channels unknown, x: fixed number of decodable audio channels.(unlabeled)
(of typestring
): Process to start.
decoder.metadata.add
Register an external file metadata decoder.
Type:
(string, ((metadata : [string * string], string) -> [string * string])) ->
unit
Arguments:
(unlabeled)
(of typestring
): Format/resolver’s name.(unlabeled)
(of type(metadata : [string * string], string) -> [string * string]
): Process to start. The function takes the format and filename as argument and returns a list of (name,value) fields.
decoder.oblivious.add
Register an external file decoder. The encoder should output in WAV
format to his standard output (stdout) and read data from the file it
receives. The estimated remaining duration for this decoder will be
unknown until the buffer
last seconds of the file. If
possible, it is recommended to decode from stdin and use
decoder.add
.
Type:
(name : string, description : string, test : ((string) -> int),
?priority : int, ?mimes : [string], ?file_extensions : [string],
?buffer : float, ((string) -> string)) -> unit
Arguments:
name
(of typestring
): Format/decoder’s name.description
(of typestring
): Description of the decoder.test
(of type(string) -> int
): Function used to determine if a file should be decoded by the decoder. Returned values are: 0: no decodable audio, -1: decodable audio but number of audio channels unknown, x: fixed number of decodable audio channels.priority
(of typeint
, which defaults to1
): Decoder prioritymimes
(of type[string]
, which defaults to[]
): List of mime types supported by this decoder. Empty means any mime type should be accepted.file_extensions
(of type[string]
, which defaults to[]
): List of file extensions. Empty means any file extension should be accepted.buffer
(of typefloat
, which defaults to5.
)(unlabeled)
(of type(string) -> string
): Process to start. The function takes the filename as argument and returns the process to start.
enable_external_faad_decoder
Enable or disable external FAAD (AAC/AAC+/M4A) decoders. Does not work on Win32. Please note that built-in support for faad is available in liquidsoap if compiled and should be preferred over the external decoder.
Type:
() -> unit
enable_external_ffmpeg_decoder
Enable ffmpeg decoder.
Type:
() -> unit
enable_external_flac_decoder
Enable external FLAC decoders. Please note that built-in support for FLAC is available in liquidsoap if compiled and should be preferred over the external decoder.
Type:
() -> unit
enable_external_mpc_decoder
Enable external Musepack decoder.
Type:
() -> unit
enable_replaygain_metadata
Enable ReplayGain metadata resolver. This resolver will process any
file decoded by Liquidsoap and add a replaygain_track_gain
metadata when this value could be computed. For a finer-grained replay
gain processing, use the replaygain:
protocol.
Type:
(?ratio : float) -> unit
Arguments:
ratio
(of typefloat
, which defaults to50.
): Decoding ratio. A value of50.
means try to decode the file50x
faster than real time, if possible. Use this setting to lower CPU peaks when computing replaygain tags.
encoder.content_type
Return the content-type (mime) of an encoder, if known.
Type:
(format('a)) -> string
Arguments:
(unlabeled)
(of typeformat('a)
)
encoder.extension
Return the file extension of an encoder, if known.
Type:
(format('a)) -> string
Arguments:
(unlabeled)
(of typeformat('a)
)
liquidsoap.chroot.make
Export all the files required to install liquidsoap in a root folder. Useful for packaging and docker images.
Type:
(string) -> unit
Arguments:
(unlabeled)
(of typestring
)
liquidsoap.executable
Path to the Liquidsoap executable.
Type:
string
liquidsoap.version.at_least
Ensure that Liquidsoap version is greater or equal to given one.
Type:
(string) -> bool
Arguments:
(unlabeled)
(of typestring
): Minimal version.
log
Log a message.
Type:
(?label : string, ?level : int, string) -> unit
Arguments:
label
(of typestring
, which defaults to"lang"
)level
(of typeint
, which defaults to3
)(unlabeled)
(of typestring
)
log.critical
Log a critical message
Type:
(?label : string, string) -> unit
Arguments:
label
(of typestring
, which defaults to"lang"
)(unlabeled)
(of typestring
)
log.debug
Log a debug message
Type:
(?label : string, string) -> unit
Arguments:
label
(of typestring
, which defaults to"lang"
)(unlabeled)
(of typestring
)
log.file
Get and set the file logging
Type:
() -> bool
log.important
Log an important message
Type:
(?label : string, string) -> unit
Arguments:
label
(of typestring
, which defaults to"lang"
)(unlabeled)
(of typestring
)
log.info
Log a normal message
Type:
(?label : string, string) -> unit
Arguments:
label
(of typestring
, which defaults to"lang"
)(unlabeled)
(of typestring
)
log.level
Get and set the log level.
Type:
() -> int
log.severe
Log a severe message
Type:
(?label : string, string) -> unit
Arguments:
label
(of typestring
, which defaults to"lang"
)(unlabeled)
(of typestring
)
log.stdout
Get and set logging to stdout
Type:
() -> bool
playlist.parse
Try to parse a local playlist. Return a list of (metadata,URI) items, where metadata is a list of (key,value) bindings.
Type:
(?path : string, ?mime : string?, string) -> [[string * string] * string]
Arguments:
path
(of typestring
, which defaults to""
): Default path for files.mime
(of typestring?
, which defaults tonull
): Mime type for the playlist(unlabeled)
(of typestring
)
playlist.parse.register
Register a new playlist parser. An empty playlist is considered as a failure to resolve.
Type:
(format : string, strict : bool,
((?pwd : string, string) -> [[string * string] * string])) -> unit
Arguments:
format
(of typestring
): Playlist format. If possible, a mime-type.strict
(of typebool
): True if playlist format can be detected unambiguously.(unlabeled)
(of type(?pwd : string, string) -> [[string * string] * string]
): Playlist parser
process.uri
Create a process: uri, replacing :
with
$(colon)
.
Type:
(?timeout : 'a?, extname : 'b, ?uri : string, string) -> string
Arguments:
timeout
(of type'a?
, which defaults tonull
)extname
(of type'b
): Output file extension (with no leading ‘.’)uri
(of typestring
, which defaults to""
): Input uri(unlabeled)
(of typestring
): Command line to execute
profiler.disable
Record profiling statistics.
Type:
() -> unit
profiler.enable
Record profiling statistics.
Type:
() -> unit
profiler.print
Print profiling information.
Type:
() -> unit
profiler.run
Time a function with the profiler.
Type:
(string, (() -> 'a)) -> 'a
Arguments:
(unlabeled)
(of typestring
): Name of the profiled function.(unlabeled)
(of type() -> 'a
): Function to profile.
profiler.stats.string
Profiling statistics.
Type:
() -> string
prometheus.latency
Monitor a source’s internal latencies on Prometheus
Type:
(?window : float, ?prefix : string, labels : [string]) ->
(label_values : [string], source('a)) -> unit
Arguments:
window
(of typefloat
, which defaults to5.
): Window over which mean and peak metrics are reported.prefix
(of typestring
, which defaults to"liquidsoap_"
): Prefix for the metric’s namelabels
(of type[string]
): labels for the metric
protocol.add
Register a new protocol.
Type:
(?temporary : bool, ?static : bool, ?syntax : string, ?doc : string, string,
((rlog : ((string) -> unit), maxtime : float, string) -> [string])) -> unit
Arguments:
temporary
(of typebool
, which defaults tofalse
): if true, file is removed when it is finished.static
(of typebool
, which defaults tofalse
): if true, then requests can be resolved once and for all. Typically, static protocols can be used to create infallible sources.syntax
(of typestring
, which defaults to"Undocumented"
): URI syntax.doc
(of typestring
, which defaults to"Undocumented"
): Protocol documentation.(unlabeled)
(of typestring
): Protocol name. Resolver will be called on uris of the form:<protocol name>:...
.(unlabeled)
(of type(rlog : ((string) -> unit), maxtime : float, string) -> [string]
): Protocol resolver. Receives a function to log protocol resolution, the<arg>
in<protocol name>:<arg>
and the max delay that resolution should take.
request.create
Create a request from an URI.
Type:
(?indicators : [string], ?persistent : bool, ?resolve_metadata : bool,
?temporary : bool, string) -> request
Arguments:
indicators
(of type[string]
, which defaults to[]
)persistent
(of typebool
, which defaults tofalse
): Indicate that the request is persistent, i.e. that it may be used again once it has been played.resolve_metadata
(of typebool
, which defaults totrue
): Set tofalse
to prevent metadata resolution on this request.temporary
(of typebool
, which defaults tofalse
): Indicate that the request is a temporary file: it will be destroyed after being played.(unlabeled)
(of typestring
)
request.destroy
Destroying a request causes any temporary associated file to be deleted, and releases its RID. Persistent requests resist to destroying, unless forced.
Type:
(?force : bool, request) -> unit
Arguments:
force
(of typebool
, which defaults tofalse
): Destroy the request even if it is persistent.(unlabeled)
(of typerequest
)
request.duration
Compute the duration in seconds of audio data contained in a request.
The computation may be expensive. Returns null
if
computation failed, typically if the file was not recognized as valid
audio.
Type:
(?metadata : [string * string], string) -> float?
Arguments:
metadata
(of type[string * string]
, which defaults to[]
): Optional metadata used to decode the file, e.g.ffmpeg_options
.(unlabeled)
(of typestring
)
request.filename
Return a valid local filename if the request is ready, and the empty string otherwise.
Type:
(request) -> string
Arguments:
(unlabeled)
(of typerequest
)
request.id
Identifier of a request.
Type:
(request) -> int
Arguments:
(unlabeled)
(of typerequest
)
request.log
Get log data associated to a request.
Type:
(request) -> string
Arguments:
(unlabeled)
(of typerequest
)
request.metadata
Get the metadata associated to a request.
Type:
(request) -> [string * string]
Arguments:
(unlabeled)
(of typerequest
)
request.read_metadata
Force reading the metadata of a request.
Type:
(request) -> unit
Arguments:
(unlabeled)
(of typerequest
)
request.resolve
Resolve a request, i.e. attempt to get a valid local file. The operation can take some time. Return true if the resolving was successful, false otherwise (timeout or invalid URI). The request should not be decoded afterward: this is mostly useful to download files such as playlists, etc.
Type:
(?content_type : source('a)?, ?timeout : float, request) -> bool
Arguments:
content_type
(of typesource('a)?
, which defaults tonull
): If specified, the request will be decoded with the same content type as the given source.timeout
(of typefloat
, which defaults to30.
): Limit in seconds to the duration of the resolving.(unlabeled)
(of typerequest
)
request.resolved
Check if a request is resolved, i.e. is associated to a valid local file.
Type:
(request) -> bool
Arguments:
(unlabeled)
(of typerequest
)
request.status
Current status of a request. Can be idle, resolving, ready, playing or destroyed.
Type:
(request) -> string
Arguments:
(unlabeled)
(of typerequest
)
request.uri
Initial URI of a request.
Type:
(request) -> string
Arguments:
(unlabeled)
(of typerequest
)
runtime.cpu.usage_getter
Create a function returning CPU usage (in float
percent
so 0.2
means 20%
) since the last time it was
called.
Type:
() -> () -> {system : float, total : float, user : float}
runtime.gc.compact
Perform a full major collection and compact the heap. Note that heap compaction is a lengthy operation.
Type:
() -> unit
runtime.gc.full_major
Trigger full major garbage collection.
Type:
() -> unit
runtime.gc.major
Trigger a minor collection and finish the current major collection cycle..
Type:
() -> unit
runtime.gc.major_slice
Do a minor collection and a slice of major collection. The optional
argument n
is the size of the slice: the GC will do enough
work to free (on average) n
words of memory. If
0
(its default), the GC will try to do enough work to
ensure that the next automatic slice has no work to do.
Type:
(?int) -> unit
Arguments:
(unlabeled)
(of typeint
, which defaults to0
): Size of the slice
runtime.gc.minor
Trigger full minor garbage collection.
Type:
() -> unit
runtime.memory
Returns information about the system and process’ memory usage.
Requires mem_usage
for a full report.
Type:
() -> unit
Methods:
pretty
(of type{ process_managed_memory : string, process_physical_memory : string, process_virtual_memory : string, total_physical_memory : string, total_used_physical_memory : string, total_used_virtual_memory : string, total_virtual_memory : string }
):process_managed_memory
(of typeint
):process_physical_memory
(of typeint
):process_virtual_memory
(of typeint
):total_physical_memory
(of typeint
):total_used_physical_memory
(of typeint
):total_used_virtual_memory
(of typeint
):total_virtual_memory
(of typeint
):
seconds_of_main
Convert a number of main ticks in seconds.
Type:
(int) -> float
Arguments:
(unlabeled)
(of typeint
)
server.execute
Execute a liquidsoap server command.
Type:
(string, ?string) -> [string]
Arguments:
(unlabeled)
(of typestring
): Command to execute.(unlabeled)
(of typestring
, which defaults to""
): Argument for the command.
List
_::_
Add an element at the top of a list.
Type:
('a, ['a]) -> ['a]
Arguments:
(unlabeled)
(of type'a
)(unlabeled)
(of type['a]
)
_[_]
l[k] returns the first v such that (k,v) is in the list l (or “” if no such v exists).
Type:
(['a * string], 'a) -> string where 'a is an orderable type
Arguments:
(unlabeled)
(of type['a * string] where 'a is an orderable type
)(unlabeled)
(of typeanything that is an orderable type
)
list.add
Add an element at the top of a list.
Type:
('a, ['a]) -> ['a]
Arguments:
(unlabeled)
(of type'a
)(unlabeled)
(of type['a]
)
list.append
Concatenate two lists.
Type:
(['a], ['a]) -> ['a]
Arguments:
(unlabeled)
(of type['a]
)(unlabeled)
(of type['a]
)
list.assoc
Associate a value to a key in an association list. This functions
raises error.not_found
if no default value is
specified.
Type:
(?default : 'a?, 'b, ['b * 'a]) -> 'a where 'b is an orderable type
Arguments:
default
(of type'a?
, which defaults tonull
): Value returned if the key is not found.(unlabeled)
(of typeanything that is an orderable type
)(unlabeled)
(of type['b * 'a] where 'b is an orderable type
)
list.assoc.filter
Keep only the elements of an association list satisfying a given predicate.
Type:
((('a, 'b) -> bool), ['a * 'b]) -> ['a * 'b]
Arguments:
(unlabeled)
(of type('a, 'b) -> bool
)(unlabeled)
(of type['a * 'b]
)
list.assoc.filter_map
Map a function of every element of the associative list, removing the
entry if the function returns null
.
Type:
((('a, 'b) -> 'c?), ['a * 'b]) -> ['c]
Arguments:
(unlabeled)
(of type('a, 'b) -> 'c?
)(unlabeled)
(of type['a * 'b]
)
list.assoc.mem
list.assoc.mem(key,l)
returns true
if
l
contains a pair (key,value).
Type:
('a, ['a * 'b]) -> bool where 'a is an orderable type
Arguments:
(unlabeled)
(of typeanything that is an orderable type
): Key to look for(unlabeled)
(of type['a * 'b] where 'a is an orderable type
): List of pairs (key,value)
list.assoc.remove
Remove the first pair from an associative list.
Type:
('a, ['a * 'b]) -> ['a * 'b] where 'a is an orderable type
Arguments:
(unlabeled)
(of typeanything that is an orderable type
): Key of pair to be removed.(unlabeled)
(of type['a * 'b] where 'a is an orderable type
): List of pairs (key,value).
list.assoc.remove.all
Remove all pairs with given key from an associative list.
Type:
('a, ['a * 'b]) -> ['a * 'b] where 'a is an orderable type
Arguments:
(unlabeled)
(of typeanything that is an orderable type
): Key of pairs to be removed.(unlabeled)
(of type['a * 'b] where 'a is an orderable type
): List of pairs (key,value).
list.case
Define a function by case analysis, depending on whether a list is empty or not.
Type:
(['a], 'b, (('a, ['a]) -> 'b)) -> 'b
Arguments:
(unlabeled)
(of type['a]
): List to perform case analysis on.(unlabeled)
(of type'b
): Result when the list is empty.(unlabeled)
(of type('a, ['a]) -> 'b
): Result when the list is non-empty.
list.cons
Add an element at the top of a list.
Type:
('a, ['a]) -> ['a]
Arguments:
(unlabeled)
(of type'a
)(unlabeled)
(of type['a]
)
list.dcase
“Delayed” version of list.case
where the value on empty
list is only evaluated if necessary.
Type:
(['a], (() -> 'b), (('a, ['a]) -> 'b)) -> 'b
Arguments:
(unlabeled)
(of type['a]
)(unlabeled)
(of type() -> 'b
)(unlabeled)
(of type('a, ['a]) -> 'b
)
list.exists
Check that a predicate is satisfied for some element in a list.
Type:
((('a) -> bool), ['a]) -> bool
Arguments:
(unlabeled)
(of type('a) -> bool
): Predicate.(unlabeled)
(of type['a]
): List
list.filter
Filter a list according to a predicate. The order in which elements are handled is not specified (and is currently implemented from the right).
Type:
(?remove : (('a) -> unit), (('a) -> bool), ['a]) -> ['a]
Arguments:
remove
(of type('a) -> unit
, which defaults tofun (_) -> ()
): Function called on an element when it is removed.(unlabeled)
(of type('a) -> bool
): Predicate indicating whether an element should be kept or not.(unlabeled)
(of type['a]
): List to filter.
list.filter_map
Map a function on a list (like list.map
) excepting that
the value is removed if the function returns null
.
Type:
((('a) -> 'b?), ['a]) -> ['b]
Arguments:
(unlabeled)
(of type('a) -> 'b?
): Function called on every element of the list.(unlabeled)
(of type['a]
): The list.
list.find
First element satisfying a predicate. Raises
error.not_found
if not element is found and no default
value was specified.
Type:
(?default : 'a?, (('a) -> bool), ['a]) -> 'a
Arguments:
default
(of type'a?
, which defaults tonull
): Returned value when the predicate is not found.(unlabeled)
(of type('a) -> bool
): Predicate.(unlabeled)
(of type['a]
): List
list.flatten
Concatenate all the elements of a list of lists.
Type:
([['a]]) -> ['a]
Arguments:
(unlabeled)
(of type[['a]]
)
list.fold
Fold a function on every element of a list:
list.fold(f,x1,[e1,..,en]) is f(...f(f(x1,e1),e2)...,en)
.
Type:
((('a, 'b) -> 'a), 'a, ['b]) -> 'a
Arguments:
(unlabeled)
(of type('a, 'b) -> 'a
): Functionf
for whichf(x,e)
which will be called on every elemente
with the current value ofx
, returning the new value ofx
.(unlabeled)
(of type'a
): Initial value x1, to be updated by successive calls off(x,e)
.(unlabeled)
(of type['b]
)
list.fold.right
Fold a function on every element of a list. Similar to
list.fold
but iterates from the right of the list. It is
slightly more efficient than list.fold
.
Type:
((('a, 'b) -> 'b), 'b, ['a]) -> 'b
Arguments:
(unlabeled)
(of type('a, 'b) -> 'b
): Functionf
for whichf(x,e)
which will be called on every elemente
with the current value ofx
, returning the new value ofx
.(unlabeled)
(of type'b
): Initial value x1, to be updated by successive calls off(x,e)
.(unlabeled)
(of type['a]
)
list.for_all
Check that a predicate is satisfied for every element in a list.
Type:
((('a) -> bool), ['a]) -> bool
Arguments:
(unlabeled)
(of type('a) -> bool
): Predicate.(unlabeled)
(of type['a]
): List
list.hd
Return the head (first element) of a list, or default
if
the list is empty.
Type:
(?default : 'a?, ['a]) -> 'a
Arguments:
default
(of type'a?
, which defaults tonull
): Default value if key does not exist.(unlabeled)
(of type['a]
)
list.ind
Define a function by induction on a list. This is slightly more efficient than defining a recursive function. The list is scanned from the right.
Type:
(['a], 'b, (('a, ['a], 'b) -> 'b)) -> 'b
Arguments:
(unlabeled)
(of type['a]
): List to perform induction on.(unlabeled)
(of type'b
): Result when the list is empty.(unlabeled)
(of type('a, ['a], 'b) -> 'b
): Result when the list is non-empty, given the current element, the tail and the result of the recursive call on the tail.
list.index
First index where a predicate is satisfied.
Type:
((('a) -> bool), ['a]) -> int
Arguments:
(unlabeled)
(of type('a) -> bool
): Predicate.(unlabeled)
(of type['a]
): List
list.indexed
Add indices to every element of a list, so that it can be accessed
with the notation l[n]
.
Type:
(['a]) -> [int * 'a]
Arguments:
(unlabeled)
(of type['a]
)
list.init
Initialize a list.
Type:
(int, ((int) -> 'a)) -> ['a]
Arguments:
(unlabeled)
(of typeint
): Number of elements in the list.(unlabeled)
(of type(int) -> 'a
): Function such thatf i
is thei
th element.
list.insert
Returns a copy of the given list with a new element inserted at a
given position. Raises error.not_found
if the list has less
than index
elements.
Type:
(int, 'a, ['a]) -> ['a]
Arguments:
(unlabeled)
(of typeint
): Index to insert at, starting at0
.(unlabeled)
(of type'a
): Element to insert(unlabeled)
(of type['a]
): List to insert into.
list.is_empty
Determining whether a list is empty or not.
Type:
(['a]) -> bool
Arguments:
(unlabeled)
(of type['a]
)
list.iter
Call a function on every element of a list.
Type:
((('a) -> unit), ['a]) -> unit
Arguments:
(unlabeled)
(of type('a) -> unit
)(unlabeled)
(of type['a]
)
list.iterator
Create an iterator over the elements of a list.
Type:
(['a?]) -> () -> 'a?
Arguments:
(unlabeled)
(of type['a?]
)
list.iteri
Call a function on every element of a list, along with its index.
Type:
(((int, 'a) -> unit), ['a]) -> unit
Arguments:
(unlabeled)
(of type(int, 'a) -> unit
)(unlabeled)
(of type['a]
)
list.last
Return the last element of a list.
Type:
(?default : 'a?, ['a]) -> 'a
Arguments:
default
(of type'a?
, which defaults tonull
)(unlabeled)
(of type['a]
)
list.length
Compute the length of a list, i.e., the number of its elements.
Type:
(['a]) -> int
Arguments:
(unlabeled)
(of type['a]
)
list.make
Create a list with given length, filled with given element.
Type:
(int, 'a) -> ['a]
Arguments:
(unlabeled)
(of typeint
): Number of elements in the list.(unlabeled)
(of type'a
): Element to fill the list with.
list.map
Map a function on every element of a list.
Type:
((('a) -> 'b), ['a]) -> ['b]
Arguments:
(unlabeled)
(of type('a) -> 'b
)(unlabeled)
(of type['a]
)
list.map.right
Map a function on every element of a list, starting from the right. This function is tail-recursive.
Type:
((('a) -> 'b), ['a]) -> ['b]
Arguments:
(unlabeled)
(of type('a) -> 'b
)(unlabeled)
(of type['a]
)
list.mapi
Map a function on every element of a list, along with its index.
Type:
(((int, 'a) -> 'b), ['a]) -> ['b]
Arguments:
(unlabeled)
(of type(int, 'a) -> 'b
)(unlabeled)
(of type['a]
)
list.mem
Check whether an element belongs to a list.
Type:
('a, ['a]) -> bool where 'a is an orderable type
Arguments:
(unlabeled)
(of typeanything that is an orderable type
)(unlabeled)
(of type['a] where 'a is an orderable type
)
list.nth
Get the n-th element of a list (the first element is at position 0),
or default
if element does not exist.
Type:
(?default : 'a?, ['a], int) -> 'a
Arguments:
default
(of type'a?
, which defaults tonull
): Default element. Raiseserror.not_found
ifnull
and no element can be found in the list.(unlabeled)
(of type['a]
)(unlabeled)
(of typeint
)
list.pick
Pick a random element in a list.
Type:
(?default : 'a?, ['a]) -> 'a
Arguments:
default
(of type'a?
, which defaults tonull
): Value returned if the list is empty.(unlabeled)
(of type['a]
): List in which the element should be picked.
list.prefix
Compute the beginning of a list.
Type:
(int, ['a]) -> ['a]
Arguments:
(unlabeled)
(of typeint
): Number of elements in the returned list.(unlabeled)
(of type['a]
): List whose prefix should be taken.
list.remove
Remove the first occurrence of a value from a list.
Type:
('a, ['a]) -> ['a]
Arguments:
(unlabeled)
(of type'a
)(unlabeled)
(of type['a]
)
list.rev
Revert list order.
Type:
(['a]) -> ['a]
Arguments:
(unlabeled)
(of type['a]
)
list.shuffle
Shuffle the content of a list. The function returns a list with the same elements but in different, random, order.
Type:
(['a]) -> ['a]
Arguments:
(unlabeled)
(of type['a]
)
list.sort
Sort a list according to a comparison function.
Type:
((('a, 'a) -> int), ['a]) -> ['a]
Arguments:
(unlabeled)
(of type('a, 'a) -> int
): Comparison function f such that f(x,y)<0 when x<y, f(x,y)=0 when x=y, and f(x,y)>0 when x>y.(unlabeled)
(of type['a]
): List to sort.
list.sort.natural
Sort a list according to the “natural” order.
Type:
(['a]) -> ['a] where 'a is an orderable type
Arguments:
(unlabeled)
(of type['a] where 'a is an orderable type
): List to sort
list.tl
Return the list without its first element.
Type:
(['a]) -> ['a]
Arguments:
(unlabeled)
(of type['a]
)
Math
*
Multiplication of numbers.
Type:
('a, 'a) -> 'a where 'a is a number type
Arguments:
(unlabeled)
(of typeanything that is a number type
)(unlabeled)
(of typeanything that is a number type
)
+
Addition of numbers.
Type:
('a, 'a) -> 'a where 'a is a number type
Arguments:
(unlabeled)
(of typeanything that is a number type
)(unlabeled)
(of typeanything that is a number type
)
-
Subtraction of numbers.
Type:
('a, 'a) -> 'a where 'a is a number type
Arguments:
(unlabeled)
(of typeanything that is a number type
)(unlabeled)
(of typeanything that is a number type
)
/
Division of numbers.
Type:
('a, 'a) -> 'a where 'a is a number type
Arguments:
(unlabeled)
(of typeanything that is a number type
)(unlabeled)
(of typeanything that is a number type
)
abs
Absolute value.
Type:
('a) -> 'a where 'a is a number type
Arguments:
(unlabeled)
(of typeanything that is a number type
)
acos
Arc cosine. The argument must fall within the range [-1.0, 1.0]. Result is in radians and is between 0.0 and pi.
Type:
(float) -> float
Arguments:
(unlabeled)
(of typefloat
)
asin
Arc sine. The argument must fall within the range [-1.0, 1.0]. Result is in radians and is between -pi/2 and pi/2.
Type:
(float) -> float
Arguments:
(unlabeled)
(of typefloat
)
atan
Arc tangent. Result is in radians and is between -pi/2 and pi/2.
Type:
(float) -> float
Arguments:
(unlabeled)
(of typefloat
)
bool_of_float
Convert a float to a bool.
Type:
(float) -> bool
Arguments:
(unlabeled)
(of typefloat
)
bool_of_int
Convert an int to a bool.
Type:
(int) -> bool
Arguments:
(unlabeled)
(of typeint
)
cos
Cosine. Argument is in radians.
Type:
(float) -> float
Arguments:
(unlabeled)
(of typefloat
)
cosh
Hyperbolic cosine. Argument is in radians.
Type:
(float) -> float
Arguments:
(unlabeled)
(of typefloat
)
dB_of_lin
Convert linear scale into decibels.
Type:
(float) -> float
Arguments:
(unlabeled)
(of typefloat
)
exp
Exponential.
Type:
(float) -> float
Arguments:
(unlabeled)
(of typefloat
)
float
Convert a number to a float.
Type:
('a) -> float where 'a is a number type
Arguments:
(unlabeled)
(of typeanything that is a number type
)
float_of_int
Convert an int to a float.
Type:
(int) -> float
Arguments:
(unlabeled)
(of typeint
)
infinity
Float representation of infinity.
Type:
float
int
Convert a number to an integer.
Type:
('a) -> int where 'a is a number type
Arguments:
(unlabeled)
(of typeanything that is a number type
)
int_of_float
Convert a float to a int.
Type:
(float) -> int
Arguments:
(unlabeled)
(of typefloat
)
lin_of_dB
Convert decibels into linear scale.
Type:
(float) -> float
Arguments:
(unlabeled)
(of typefloat
)
ln
Natural logarithm.
Type:
(float) -> float
Arguments:
(unlabeled)
(of typefloat
)
log10
Base 10 logarithm.
Type:
(float) -> float
Arguments:
(unlabeled)
(of typefloat
)
lsl
Logical shift left.
Type:
(int, int) -> int
Arguments:
(unlabeled)
(of typeint
): Number to shift.(unlabeled)
(of typeint
): Number of bits to shift.
lsr
Logical shift right.
Type:
(int, int) -> int
Arguments:
(unlabeled)
(of typeint
): Number to shift.(unlabeled)
(of typeint
): Number of bits to shift.
max
Compute the maximum of two values.
Type:
('a, 'a) -> 'a where 'a is an orderable type
Arguments:
(unlabeled)
(of typeanything that is an orderable type
)(unlabeled)
(of typeanything that is an orderable type
)
max_int
Maximal representable integer.
Type:
int
min
Compute the minimum of two values.
Type:
('a, 'a) -> 'a where 'a is an orderable type
Arguments:
(unlabeled)
(of typeanything that is an orderable type
)(unlabeled)
(of typeanything that is an orderable type
)
min_int
Minimal representable integer.
Type:
int
mod
Remainder of division of numbers.
Type:
('a, 'a) -> 'a where 'a is a number type
Arguments:
(unlabeled)
(of typeanything that is a number type
)(unlabeled)
(of typeanything that is a number type
)
nan
A special floating-point value denoting the result of an undefined
operation such as 0.0 /. 0.0. Stands for ‘not a number’. Any
floating-point operation with nan as argument returns nan as result. As
for floating-point comparisons, ==
, <
,
<=
, >
and >=
return
false
and !=
returns true
if one
or both of their arguments is nan
.
Type:
float
pow
Exponentiation of numbers.
Type:
('a, 'a) -> 'a where 'a is a number type
Arguments:
(unlabeled)
(of typeanything that is a number type
)(unlabeled)
(of typeanything that is a number type
)
random.float
Generate a random value between min
(included) and
max
(excluded).
Type:
(?min : float, ?max : float) -> float
Arguments:
min
(of typefloat
, which defaults to0.
)max
(of typefloat
, which defaults to1.
)
random.int
Generate a random value between min
(included) and
max
(excluded).
Type:
(?min : int, ?max : int) -> int
Arguments:
min
(of typeint
, which defaults to-536870911
)max
(of typeint
, which defaults to536870912
)
sin
Sine. Argument is in radians.
Type:
(float) -> float
Arguments:
(unlabeled)
(of typefloat
)
sinh
Hyperbolic sine. Argument is in radians.
Type:
(float) -> float
Arguments:
(unlabeled)
(of typefloat
)
sqrt
Square root.
Type:
(float) -> float
Arguments:
(unlabeled)
(of typefloat
)
tan
Tangent. Argument is in radians.
Type:
(float) -> float
Arguments:
(unlabeled)
(of typefloat
)
tanh
Hyperbolic tangent. Argument is in radians.
Type:
(float) -> float
Arguments:
(unlabeled)
(of typefloat
)
~-
Returns the opposite of its argument.
Type:
('a) -> 'a where 'a is a number type
Arguments:
(unlabeled)
(of typeanything that is a number type
)
Metadata
file.cover
Obtain cover-art for a file. null
is returned in case
there is no such information.
Type:
(string) -> string
.{
color_depth? : int,
description? : string,
format? : string,
height? : int,
mime : string,
number_of_colors? : int?,
picture_type? : int,
width? : int}?
Arguments:
(unlabeled)
(of typestring
): File from which the cover should be obtained
metadata.artist
Extract artist from metadata.
Type:
([string * string]) -> string
Arguments:
(unlabeled)
(of type[string * string]
)
metadata.comment
Extract comment from metadata.
Type:
([string * string]) -> string
Arguments:
(unlabeled)
(of type[string * string]
)
metadata.cover
Extract cover from metadata. This function implements cover extraction for the following formats: coverart (ogg), apic (flac, mp3) and pic (mp3).
Type:
(?coverart_mime : string?, [string * string]) -> string
.{
color_depth? : int,
description? : string,
format? : string,
height? : int,
mime : string,
number_of_colors? : int?,
picture_type? : int,
width? : int}?
Arguments:
coverart_mime
(of typestring?
, which defaults tonull
): Mime type to use for"coverart"
metadata. Support disabled ifnull
.(unlabeled)
(of type[string * string]
): Metadata from which the cover should be extracted.
metadata.cover.remove
Remove cover metadata. This is mostly useful in order not to flood logs with coverart when logging metadata.
Type:
([string * 'a]) -> [string * 'a]
Arguments:
(unlabeled)
(of type[string * 'a]
)
metadata.deduplicate
Remove duplicate metadata in a source.
Type:
(?id : string?, source('a)) -> source('a)
where 'a is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults to"metadata.deduplicate"
): Source id(unlabeled)
(of typesource('a) where 'a is a set of tracks to be muxed into a source
): source
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
metadata.export
Cleanup metadata for export. This is used to remove Liquidsoap’s
internal metadata entries before sending them. List of exported metadata
is set using settings.encoder.metadata.export.set
.
Type:
([string * string]) -> [string * string]
Arguments:
(unlabeled)
(of type[string * string]
)
metadata.filename
Extract filename from metadata.
Type:
([string * string]) -> string
Arguments:
(unlabeled)
(of type[string * string]
)
metadata.getter
Create a getter from a metadata: this is a string, whose value can be changed with a metadata.
Type:
(string, 'a, 'c.{on_metadata : (((['a * string]) -> unit)) -> 'b}) ->
() -> string where 'a is an orderable type
Arguments:
(unlabeled)
(of typestring
): Initial value.(unlabeled)
(of typeanything that is an orderable type
): Metadata on which the value should be updated.(unlabeled)
(of type'c.{on_metadata : (((['a * string]) -> unit)) -> 'b} where 'a is an orderable type
): Source containing the metadata.
metadata.getter.float
Create a float getter from a metadata: this is a float, whose value can be changed with a metadata.
Type:
(float, 'a, 'c.{on_metadata : (((['a * string]) -> unit)) -> 'b}) ->
() -> float where 'a is an orderable type
Arguments:
(unlabeled)
(of typefloat
): Initial value.(unlabeled)
(of typeanything that is an orderable type
): Metadata on which the value should be updated.(unlabeled)
(of type'c.{on_metadata : (((['a * string]) -> unit)) -> 'b} where 'a is an orderable type
): Source containing the metadata.
metadata.json.parse
Parse metadata from JSON object.
Type:
(string) -> [string * string] as json.object
Arguments:
(unlabeled)
(of typestring
)
metadata.json.stringify
Export metadata as JSON object. Cover art, if found, is extracted
using metadata.cover
and exported with key
"cover"
and exported using
string.data_uri.encode
.
Type:
(?coverart_mime : string?, ?base64 : bool, ?compact : bool, ?json5 : bool,
[string * string]) -> string
Arguments:
coverart_mime
(of typestring?
, which defaults tonull
): Mime type to use for"coverart"
metadata. Support disasbled ifnull
.base64
(of typebool
, which defaults totrue
)compact
(of typebool
, which defaults tofalse
): Output compact text.json5
(of typebool
, which defaults tofalse
): Use json5 extended spec.(unlabeled)
(of type[string * string]
)
metadata.title
Extract title from metadata.
Type:
([string * string]) -> string
Arguments:
(unlabeled)
(of type[string * string]
)
string.apic.parse
Parse APIC ID3v2 tags (such as those obtained in the APIC tag from
file.metadata.id3v2
). The returned values are: mime,
picture type, description, and picture data.
Type:
(string) -> string
Arguments:
(unlabeled)
(of typestring
): APIC data.
Methods:
description
(of typestring
): Descriptionmime
(of typestring
): Mime typepicture_type
(of typeint
): Picture type
string.pic.parse
Parse PIC ID3v2 tags (such as those obtained in the PIC tag from
file.metadata.id3v2
). The returned values are: format,
picture type, description, and picture data.
Type:
(string) -> string
Arguments:
(unlabeled)
(of typestring
): PIC data.
Methods:
description
(of typestring
): Descriptionformat
(of typestring
): Picture formatpicture_type
(of typeint
): Picture type
track.metadata.deduplicate
Remove duplicate metadata in a track.
Type:
(?id : string?, metadata) -> metadata
Arguments:
id
(of typestring?
, which defaults to"track.metadata.deduplicate"
)(unlabeled)
(of typemetadata
)
Programming
assert
Ensure that a condition is satisfied (raise
error.assertion
exception otherwise).
Type:
(bool) -> unit
Arguments:
(unlabeled)
(of typebool
): Condition which should be satisfied.
error.on_error
Register a callback to monitor errors raised during the execution of the program. The callback is allow to re-raise a different error if needed.
Type:
(((error
.{
kind : string,
message : string,
trace : [
{
position_end :
{character_offset : int, filename : string, line_number : int
},
position_start :
{character_offset : int, filename : string, line_number : int
},
to_string : (?prefix : string) -> string
}]
}) -> unit)) -> unit
Arguments:
(unlabeled)
(of type(error .{ kind : string, message : string, trace : [ { position_end : {character_offset : int, filename : string, line_number : int }, position_start : {character_offset : int, filename : string, line_number : int }, to_string : (?prefix : string) -> string }] }) -> unit
)
error.raise
Raise an error.
Type:
(error, ?string) -> 'a
Arguments:
(unlabeled)
(of typeerror
): Error kind.(unlabeled)
(of typestring
, which defaults to""
): Description of the error.
error.register
Register an error of the given kind
Type:
(string) -> error
Arguments:
(unlabeled)
(of typestring
): Kind of the error
Methods:
kind
(of typestring
): Error kind.message
(of typestring
): Error message.trace
(of type[ { position_end : {character_offset : int, filename : string, line_number : int }, position_start : {character_offset : int, filename : string, line_number : int }, to_string : (?prefix : string) -> string }]
): Error stacktrace.
failwith
Major failure.
Type:
(string) -> 'a
Arguments:
(unlabeled)
(of typestring
): Explanation about the failure.
fst
Get the first component of a pair.
Type:
(('a * 'b)) -> 'a
Arguments:
(unlabeled)
(of type'a * 'b
)
ignore
Convert anything to unit, preventing warnings.
Type:
('a) -> unit
Arguments:
(unlabeled)
(of type'a
)
memoize
Memoize the result of a function, making sure it is only executed once.
Type:
((() -> 'a)) -> () -> 'a where 'a is an orderable type
Arguments:
(unlabeled)
(of type() -> 'a where 'a is an orderable type
)
null
Create a nullable value.
Type:
(?'a?) -> 'a?
Arguments:
(unlabeled)
(of type'a?
, which defaults tonull
): Value to make nullable.
null.case
Return a result dending on whether a value is nothing or not.
Type:
('a?, (() -> 'b), (('a) -> 'b)) -> 'b
Arguments:
(unlabeled)
(of type'a?
): Value to reason by case analysis on.(unlabeled)
(of type() -> 'b
): Value to return in case we have nothing.(unlabeled)
(of type('a) -> 'b
): Value to return in case we have something.
null.default
Return a result dending on whether a value is nothing or not.
Type:
('a?, (() -> 'a)) -> 'a
Arguments:
(unlabeled)
(of type'a?
): Value to reason by case analysis on.(unlabeled)
(of type() -> 'a
): Value to return in case we have nothing.
null.defined
Determine whether a nullable value is not null.
Type:
('a?) -> bool
Arguments:
(unlabeled)
(of type'a?
)
null.find
Find the first element of a list for which the image of the function
is not null
. Raises error.not_found
if not
element is found and no default value was specified.
Type:
(?default : 'a??, (('b) -> 'a?), ['b]) -> 'a?
Arguments:
default
(of type'a??
, which defaults tonull
): Returned value when no element is found.(unlabeled)
(of type('b) -> 'a?
): Function.(unlabeled)
(of type['b]
): List.
null.get
Get the value of a nullable. Raises error.not_found
if
the value is null
and no default value was specified.
Type:
(?default : 'a?, 'a?) -> 'a
Arguments:
default
(of type'a?
, which defaults tonull
): Returned value when the value isnull
.(unlabeled)
(of type'a?
)
null.map
Apply a function on a nullable value if it is not null, and return null otherwise.
Type:
((('a) -> 'b?), 'a?) -> 'b?
Arguments:
(unlabeled)
(of type('a) -> 'b?
)(unlabeled)
(of type'a?
)
null.to_list
Convert a nullable value to a list containing zero or one element depending on whether the value is null or not.
Type:
('a?) -> ['a]
Arguments:
(unlabeled)
(of type'a?
)
position
Return the current position in the script
Type:
() -> unit
Methods:
character_offset
(of typeint
): character offsetfilename
(of typestring
): filenameline_number
(of typeint
): line number
predicate.activates
Detect when a predicate becomes true.
Type:
(?init : bool, (() -> bool)) -> () -> bool
Arguments:
init
(of typebool
, which defaults tofalse
): Detect at beginning.(unlabeled)
(of type() -> bool
): Predicate.
predicate.at_most
Limit the number of times a predicate is true is a row.
Type:
(int, (() -> bool)) -> () -> bool
Arguments:
(unlabeled)
(of typeint
): Number of times the predicate is allowed to be true.(unlabeled)
(of type() -> bool
): Predicate.
predicate.changes
Detect when a predicate changes.
Type:
((() -> 'a)) -> () -> bool where 'a is an orderable type
Arguments:
(unlabeled)
(of type() -> 'a where 'a is an orderable type
): Predicate.
predicate.first
First occurrence of a predicate.
Type:
((() -> bool)) -> () -> bool
Arguments:
(unlabeled)
(of type() -> bool
): Predicate.
predicate.once
Become true once every time a predicate is true.
Type:
((() -> bool)) -> () -> bool
Arguments:
(unlabeled)
(of type() -> bool
): Predicate.
predicate.signal
Predicate which is true when a signal is sent. The returned predicate
has a method signal
to send the signal.
Type:
() -> () -> bool
Methods:
signal
(of type() -> unit
): Send a signal.
print
Print on standard output.
Type:
(?newline : bool, 'a) -> unit
Arguments:
newline
(of typebool
, which defaults totrue
): If true, a newline is added after displaying the value.(unlabeled)
(of type'a
)
ref
Create a reference, i.e. a value which can be modified.
Type:
('a) -> () -> 'a
Arguments:
(unlabeled)
(of type'a
)
Methods:
set
(of type('A) -> unit
): Set the value of the reference.
ref.getter
Create a getter from a reference (sometimes useful to remove the
set
method).
Type:
((() -> 'a).{set : ('a) -> unit}) -> () -> 'a
Arguments:
(unlabeled)
(of type(() -> 'a).{set : ('a) -> unit}
)
ref.incr
Increment a reference to an integer.
Type:
((() -> int).{set : (int) -> 'a}) -> 'a
Arguments:
(unlabeled)
(of type(() -> int).{set : (int) -> 'a}
)
ref.make
Create a reference from a pair of get / set functions.
Type:
((() -> 'a), (('a) -> unit)) -> () -> 'a
Arguments:
(unlabeled)
(of type() -> 'a
): Function to retrieve the value of the reference.(unlabeled)
(of type('a) -> unit
): Function to change the value of the reference.
Methods:
set
(of type('A) -> unit
): Set the value of the reference.
ref.map
Map functions to a reference.
Type:
((('a) -> 'b), (('b) -> 'a), (() -> 'a).{set : ('a) -> unit}) -> () -> 'b
Arguments:
(unlabeled)
(of type('a) -> 'b
): Function to apply to the getter.(unlabeled)
(of type('b) -> 'a
): Function to apply to the setter.(unlabeled)
(of type(() -> 'a).{set : ('a) -> unit}
)
Methods:
set
(of type('A) -> unit
): Set the value of the reference.
snd
Get the second component of a pair.
Type:
(('a * 'b)) -> 'b
Arguments:
(unlabeled)
(of type'a * 'b
)
thread.on_error
Register the function to be called when an error of the given kind is
raised in a thread. Catches all errors if first argument is
null
.
Type:
(error
.{
kind : string,
message : string,
trace : [
{
position_end :
{character_offset : int, filename : string, line_number : int
},
position_start :
{character_offset : int, filename : string, line_number : int
},
to_string : (?prefix : string) -> string
}]
}?,
((backtrace : string, error
.{
kind : string,
message : string,
trace : [
{
position_end :
{character_offset : int, filename : string, line_number : int
},
position_start :
{character_offset : int, filename : string, line_number : int
},
to_string : (?prefix : string) -> string
}]
}) -> unit)) -> unit
Arguments:
(unlabeled)
(of typeerror .{ kind : string, message : string, trace : [ { position_end : {character_offset : int, filename : string, line_number : int }, position_start : {character_offset : int, filename : string, line_number : int }, to_string : (?prefix : string) -> string }] }?
)(unlabeled)
(of type(backtrace : string, error .{ kind : string, message : string, trace : [ { position_end : {character_offset : int, filename : string, line_number : int }, position_start : {character_offset : int, filename : string, line_number : int }, to_string : (?prefix : string) -> string }] }) -> unit
)
thread.pause
Pause execution for a given amount of seconds. This freezes the calling thread and should not be used in the main streaming loop.
Type:
(float) -> unit
Arguments:
(unlabeled)
(of typefloat
): Number of seconds of pause.
thread.run
Run a function in a separate thread.
Type:
(?fast : bool, ?delay : float, ?every : {float}?, (() -> unit)) -> unit
Arguments:
fast
(of typebool
, which defaults totrue
): Whether the thread is supposed to return quickly or not. Typically, blocking tasks (e.g. fetching data over the internet) should not be considered to be fast. When set tofalse
its priority will be lowered below that of request resolutions and fast timeouts. This is only effective if you set a dedicated queue for fast tasks, see the “scheduler” settings for more details.delay
(of typefloat
, which defaults to0.
): Delay (in seconds) after which the thread should be launched.every
(of type{float}?
, which defaults tonull
): How often (in seconds) the thread should be run. If negative ornull
, run once.(unlabeled)
(of type() -> unit
): Function to execute.
thread.run.recurrent
Run a recurrent function in a separate thread.
Type:
(?fast : bool, ?delay : float, (() -> float)) -> unit
Arguments:
fast
(of typebool
, which defaults totrue
): Whether the thread is supposed to return quickly or not. Typically, blocking tasks (e.g. fetching data over the internet) should not be considered to be fast. When set tofalse
its priority will be lowered below that of request resolutions and fast timeouts. This is only effective if you set a dedicated queue for fast tasks, see the “scheduler” settings for more details.delay
(of typefloat
, which defaults to0.
): Delay (in sec.) after which the thread should be launched.(unlabeled)
(of type() -> float
): Function to execute recurrently. The returned value is the delay (in sec.) in which the function should be run again (it won’t be run if the value is strictly negative).
thread.when
Execute a callback when a predicate is true
. The
predicate is checked every
seconds and the callback is
called when the predicate returns true
after having been
false
, following the same semantics as
predicate.activates
.
Type:
(?fast : bool, ?init : bool, ?every : {float}, ?once : bool, ?changed : bool,
(() -> bool), (() -> 'a)) -> unit
Arguments:
fast
(of typebool
, which defaults totrue
): Whether the callback is supposed to return quickly or not.init
(of typebool
, which defaults totrue
): Detect at beginning.every
(of type{float}
, which defaults to0.5
): How often (in sec.) to check for the predicate.once
(of typebool
, which defaults tofalse
): Execute the function only once.changed
(of typebool
, which defaults totrue
): Execute the function only if the predicate was false when last checked.(unlabeled)
(of type() -> bool
): Predicate indicating when to execute the function, typically a time interval such as{10h-10h30}
.(unlabeled)
(of type() -> 'a
): Function to execute when the predicate is true.
while
A while loop.
Type:
({bool}, (() -> unit)) -> unit
Arguments:
(unlabeled)
(of type{bool}
): Condition guarding the loop.(unlabeled)
(of type() -> unit
): Function to execute.
Settings
audio.channels
Channels for audio.
Type:
() -> int
audio.samplerate
Samplerate for audio.
Type:
() -> int
frame.duration
Duration of a frame.
Type:
() -> float
Source / Audio processing
add
Mix sources, with optional normalization. Only relay metadata from the first available source. Track marks are dropped from all sources.
Type:
(?id : string?, ?normalize : {bool}, ?power : {bool}, ?weights : [{float}],
[source('a)]) -> source('a)
where 'a is a set of internal tracks
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.normalize
(of type{bool}
, which defaults totrue
): Divide by the sum of weights of ready sources (or by the number of ready sources if weights are not specified).power
(of type{bool}
, which defaults tofalse
): Perform constant-power normalization.weights
(of type[{float}]
, which defaults to[]
): Relative weight of the sources in the sum. The empty list stands for the homogeneous distribution. These are used as amplification coefficients if we are not normalizing.(unlabeled)
(of type[source('a)] where 'a is a set of internal tracks
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
amplify
Multiply the amplitude of the signal.
Type:
(?id : string?, ?override : string?, {float}, source(audio=pcm('a), 'b)) ->
source(audio=pcm('a), 'b)
where 'b is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults to"amplify"
): Force the value of the track ID.override
(of typestring?
, which defaults to"liq_amplify"
): Specify the name of a metadata field that, when present and well-formed, overrides the amplification factor for the current track. Well-formed values are floats in decimal notation (e.g.0.7
) which are taken as normal/linear multiplicative factors; values can be passed in decibels with the suffixdB
(e.g.-8.2 dB
, but the spaces do not matter).(unlabeled)
(of type{float}
): Multiplicative factor.(unlabeled)
(of typesource(audio=pcm('a), 'b) where 'b is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
audio.decode.pcm_f32
Decode audio track to pcm_f32
Type:
(?id : string?, source(audio=pcm_f32('a), 'b)) -> source(audio=pcm('a), 'b)
where 'b is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults to"audio.decode.pcm_f32"
)(unlabeled)
(of typesource(audio=pcm_f32('a), 'b) where 'b is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
audio.decode.pcm_s16
Decode audio track to pcm_s16
Type:
(?id : string?, source(audio=pcm_s16('a), 'b)) -> source(audio=pcm('a), 'b)
where 'b is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults to"audio.decode.pcm_s16"
)(unlabeled)
(of typesource(audio=pcm_s16('a), 'b) where 'b is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
audio.encode.pcm_f32
Encode audio track to pcm_f32
Type:
(?id : string?, source(audio=pcm('a), 'b)) -> source(audio=pcm_f32('a), 'b)
where 'b is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults to"audio.encode.pcm_f32"
)(unlabeled)
(of typesource(audio=pcm('a), 'b) where 'b is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
audio.encode.pcm_s16
Encode audio track to pcm_s16
Type:
(?id : string?, source(audio=pcm('a), 'b)) -> source(audio=pcm_s16('a), 'b)
where 'b is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults to"audio.encode.pcm_s16"
)(unlabeled)
(of typesource(audio=pcm('a), 'b) where 'b is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
clip
Clip samples, i.e. ensure that all values are between -1
and 1
: values lower than -1
become
-1
and values higher than 1
become
1
. nan
values become 0
.
Type:
(?id : string?, source(audio=pcm('a), 'b)) -> source(audio=pcm('a), 'b)
where 'b is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults to"clip"
): Force the value of the track ID.(unlabeled)
(of typesource(audio=pcm('a), 'b) where 'b is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
delay_line
Delay the audio signal by a given amount of time.
Type:
(?id : string?, {float}, source(audio=pcm('a), 'b)) -> source(audio=pcm('a),
'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.(unlabeled)
(of type{float}
): Duration of the delay in seconds.(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
dtmf.detect
Detect DTMF tones.
Type:
(?id : string?, ?bands : int, ?debug : {bool}, ?duration : {float},
?smoothing : {float}, ?threshold : {float}, source(audio=pcm('a), 'b),
((string) -> unit)) -> source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.bands
(of typeint
, which defaults to1024
): Number of frequency bands.debug
(of type{bool}
, which defaults tofalse
): Show internal values on standard output in order to fine-tune parameters: band number, band frequency, detected intensity and smoothed intensity.duration
(of type{float}
, which defaults to0.05
): Duration for detecting a tone.smoothing
(of type{float}
, which defaults to0.01
): Smoothing time (in seconds) for band indensity (the higher, the less sensitive we are to local variations, but the more time we take to detect a band).threshold
(of type{float}
, which defaults to50.
): Threshold for detecting a band.(unlabeled)
(of typesource(audio=pcm('a), 'b)
): Source on which DTMF tones should be detected.(unlabeled)
(of type(string) -> unit
): Function called with detected key as argument.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
echo
Add echo.
Type:
(?id : string?, ?delay : {float}, ?feedback : {float}, ?ping_pong : bool,
source(audio=pcm('a), 'b)) -> source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.delay
(of type{float}
, which defaults to0.5
): Delay in seconds.feedback
(of type{float}
, which defaults to-6.
): Feedback coefficient in dB (negative).ping_pong
(of typebool
, which defaults tofalse
): Use ping-pong delay.(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
filter
Perform several kinds of filtering on the signal. Only frequencies
below the sampling rate / 4 (generally 10 kHz) are handled well for the
freq
parameter.
Type:
(?id : string?, freq : {float}, mode : string, ?q : {float},
?wetness : {float}, source(audio=pcm('a), 'b)) -> source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.freq
(of type{float}
): Characteristic frequency of the filter.mode
(of typestring
): Available modes are ‘low’ (for low-pass filter), ‘high’ (for high-pass filter), ‘band’ (for band-pass filter) and ‘notch’ (for notch / band-stop / band-rejection filter).q
(of type{float}
, which defaults to1.
)wetness
(of type{float}
, which defaults to1.
): How much of the original signal should be added (1. means only filtered and 0. means only original signal).(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
filter.fir
Low-pass FIR filter.
Type:
(?id : string?, beta : float, ?coeffs : int, frequency : float,
source(audio=pcm('a), 'b)) -> source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.beta
(of typefloat
): Beta should range between 0 and 1.coeffs
(of typeint
, which defaults to255
): Number of coefficientsfrequency
(of typefloat
): Corner frequency in Hz (frequency at which the response is 0.5, that is -6 dB).(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
filter.iir.butterworth.bandpass
IIR filter
Type:
(?id : string?, frequency1 : float, frequency2 : float, ?order : int,
source(audio=pcm('a), 'b)) -> source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.frequency1
(of typefloat
): First corner frequencyfrequency2
(of typefloat
): Second corner frequencyorder
(of typeint
, which defaults to4
): Filter order(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
filter.iir.butterworth.bandstop
IIR filter
Type:
(?id : string?, frequency1 : float, frequency2 : float, ?order : int,
source(audio=pcm('a), 'b)) -> source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.frequency1
(of typefloat
): First corner frequencyfrequency2
(of typefloat
): Second corner frequencyorder
(of typeint
, which defaults to4
): Filter order(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
filter.iir.butterworth.high
IIR filter
Type:
(?id : string?, frequency : float, ?order : int, source(audio=pcm('a), 'b)) ->
source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.frequency
(of typefloat
): Corner frequencyorder
(of typeint
, which defaults to4
): Filter order(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
filter.iir.butterworth.low
IIR filter
Type:
(?id : string?, frequency : float, ?order : int, source(audio=pcm('a), 'b)) ->
source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.frequency
(of typefloat
): Corner frequencyorder
(of typeint
, which defaults to4
): Filter order(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
filter.iir.eq.allpass
All-pass biquad filter.
Type:
(?id : string?, ?bandwidth : {float}, frequency : {float}, source('a)) ->
source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.bandwidth
(of type{float}
, which defaults to0.333333333333
): Bandwidth (in octaves)frequency
(of type{float}
): Center frequency(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
filter.iir.eq.bandpass
Band-pass biquad filter.
Type:
(?id : string?, frequency : {float}, ?q : {float}, source('a)) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.frequency
(of type{float}
): Center frequencyq
(of type{float}
, which defaults to1.
): Q(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
filter.iir.eq.high
High-pass biquad filter.
Type:
(?id : string?, frequency : {float}, ?q : {float}, source('a)) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.frequency
(of type{float}
): Corner frequencyq
(of type{float}
, which defaults to1.
): Q(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
filter.iir.eq.highshelf
High shelf biquad filter.
Type:
(?id : string?, frequency : {float}, ?slope : {float}, source('a)) ->
source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.frequency
(of type{float}
): Center frequencyslope
(of type{float}
, which defaults to1.
): Shelf slope (in dB/octave)(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
filter.iir.eq.low
Low-pass biquad filter.
Type:
(?id : string?, frequency : {float}, ?q : {float}, source('a)) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.frequency
(of type{float}
): Corner frequencyq
(of type{float}
, which defaults to1.
): Q(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
filter.iir.eq.lowshelf
Low shelf biquad filter.
Type:
(?id : string?, frequency : {float}, ?slope : {float}, source('a)) ->
source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.frequency
(of type{float}
): Corner frequencyslope
(of type{float}
, which defaults to1.
): Shelf slope (dB/octave)(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
filter.iir.eq.notch
Band-pass biquad filter.
Type:
(?id : string?, frequency : {float}, ?q : {float}, source('a)) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.frequency
(of type{float}
): Center frequencyq
(of type{float}
, which defaults to1.
): Q(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
filter.iir.eq.peak
Peak EQ biquad filter.
Type:
(?id : string?, frequency : {float}, ?gain : {float}, ?q : {float},
source('a)) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.frequency
(of type{float}
): Center frequencygain
(of type{float}
, which defaults to1.
): Gain (in dB)q
(of type{float}
, which defaults to1.
): Q(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
filter.iir.resonator.allpass
IIR filter
Type:
(?id : string?, frequency : float, ?q : float, source(audio=pcm('a), 'b)) ->
source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.frequency
(of typefloat
): Corner frequencyq
(of typefloat
, which defaults to60.
): Quality factor(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
filter.iir.resonator.bandpass
IIR filter
Type:
(?id : string?, frequency : float, ?q : float, source(audio=pcm('a), 'b)) ->
source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.frequency
(of typefloat
): Corner frequencyq
(of typefloat
, which defaults to60.
): Quality factor(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
filter.iir.resonator.bandstop
IIR filter
Type:
(?id : string?, frequency : float, ?q : float, source(audio=pcm('a), 'b)) ->
source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.frequency
(of typefloat
): Corner frequencyq
(of typefloat
, which defaults to60.
): Quality factor(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
filter.rc
First-order filter (RC filter).
Type:
(?id : string?, frequency : {float}, mode : string, ?wetness : {float},
source(audio=pcm('a), 'b)) -> source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.frequency
(of type{float}
): Cutoff frequency.mode
(of typestring
): Available modes are ‘low’ (for low-pass filter), ‘high’ (for high-pass filter).wetness
(of type{float}
, which defaults to1.
): How much of the original signal should be added (1. means only filtered and 0. means only original signal).(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
flanger
Flanger effect.
Type:
(?id : string?, ?delay : float, ?feedback : {float}, ?freq : {float},
?phase : {float}, source(audio=pcm('a), 'b)) -> source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.delay
(of typefloat
, which defaults to0.001
): Delay in seconds.feedback
(of type{float}
, which defaults to0.
): Feedback coefficient in dB.freq
(of type{float}
, which defaults to0.5
): Frequency in Hz.phase
(of type{float}
, which defaults to1.
): Phase difference between channels in radians.(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
gate
Reduce the volume when the stream is silent (typically in order to avoid low intensity noise).
Type:
(?id : string?, ?attack : {float}, ?hold : {float}, ?range : {float},
?release : {float}, ?threshold : {float}, ?window : {float},
source(audio=pcm('a), 'b)) -> source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.attack
(of type{float}
, which defaults to10.
): Time to fully open the gate (ms).hold
(of type{float}
, which defaults to1000.
): Minimum amount of time the gate stays open (ms).range
(of type{float}
, which defaults to-30.
): Difference between closed and open level (dB).release
(of type{float}
, which defaults to2000.
): Time to fully close the gate (ms).threshold
(of type{float}
, which defaults to-30.
): Threshold at which the gate will open (dB).window
(of type{float}
, which defaults to1.
): Duration for computing peak (ms).(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.gate
(of type() -> float
): Position of the gate (0. means closed, 1. means open).id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
normalize
Normalization the volume of a stream (this is also called
automatic gain control). Dynamic normalization of the signal is
sometimes the only option (for instance, for live sources), and can make
a listening experience much nicer. However, its dynamic aspect implies
some limitations which can go as far as creating saturation in some
extreme cases. If possible, consider using some track-based
normalization techniques such as those based on ReplayGain. The
implementation of Liquidsoap < 2.0 was renamed to
normalize.old
.
Type:
(?id : string?, ?target : {float}, ?up : {float}, ?down : {float},
?gain_min : float, ?gain_max : float, ?lufs : bool, ?lookahead : {float},
?window : {float}, ?threshold : {float}, ?track_sensitive : bool,
?debug : float??, source(audio=pcm('a), 'b)) -> source(audio=pcm('a), 'b)
where 'b is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.target
(of type{float}
, which defaults to-13.
): Desired RMS (dB).up
(of type{float}
, which defaults to10.
): Characteristic time to go up.down
(of type{float}
, which defaults to0.1
): Characteristic time to go down.gain_min
(of typefloat
, which defaults to-12.
): Minimal gain value (dB).gain_max
(of typefloat
, which defaults to12.
): Maximal gain value (dB).lufs
(of typebool
, which defaults tofalse
): Use LUFS instead of RMS to compute intensity.lookahead
(of type{float}
, which defaults to0.
): How much time to look ahead of the signal (second). Setting a positive value delays the output by the corresponding amount of time.window
(of type{float}
, which defaults to0.5
): Duration of the window used to compute the current RMS power (second).threshold
(of type{float}
, which defaults to-40.
): Minimal RMS for activaing gain control (dB).track_sensitive
(of typebool
, which defaults totrue
)debug
(of typefloat??
, which defaults tonull
): How often to print debug messages, in seconds, useful to finetune the parameters. You should setset("log.level", 5)
to see them.(unlabeled)
(of typesource(audio=pcm('a), 'b) where 'b is a set of tracks to be muxed into a source
): Source to normalize.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.gain
(of type() -> float
): Current amplification coefficient (in linear scale).id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.rms
(of type() -> float
): Current rms (in linear scale).seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.target_gain
(of type() -> float
): Current target amplification coefficient (in linear scale).time
(of type() -> float
): Get a source’s time, based on its assigned clock.
normalize.old
Normalize the signal. Dynamic normalization of the signal is
sometimes the only option, and can make a listening experience much
nicer. However, its dynamic aspect implies some limitations which can go
as far as creating saturation in some extreme cases. If possible,
consider using some track-based normalization techniques such as those
based on replay gain. See the documentation for more details. This is
the implementation provided in Liquidsoap < 2.0. A new, better and
more customizable one is now given in normalize
.
Type:
(?id : string?, ?gain_max : {float}, ?gain_min : {float}, ?k_down : {float},
?k_up : {float}, ?target : {float}, ?threshold : {float},
?track_sensitive : bool, ?window : float, source(audio=pcm('a), 'b)) ->
source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.gain_max
(of type{float}
, which defaults to6.
): Maximal gain value (dB).gain_min
(of type{float}
, which defaults to-6.
): Minimal gain value (dB).k_down
(of type{float}
, which defaults to0.1
): Coefficient when the power must go down (between 0 and 1, slowest to fastest).k_up
(of type{float}
, which defaults to0.005
): Coefficient when the power must go up (between 0 and 1, slowest to fastest).target
(of type{float}
, which defaults to-13.
): Desired RMS (dB).threshold
(of type{float}
, which defaults to-40.
): Minimal RMS for activaing gain control (dB).track_sensitive
(of typebool
, which defaults totrue
): Reset values on every track.window
(of typefloat
, which defaults to0.1
): Duration of the window used to compute the current RMS power (second).(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.gain
(of type() -> float
): Current amplification coefficient.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.rms
(of type() -> float
): Current RMS.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
peak
Get current peak volume of the source. Returns the source with a
method peak
to compute the current peak volume of the
source, with 0.0 <= peak volume <= 1.0
.
Type:
(?id : string?, ?duration : {float}, source(audio=pcm('a), 'b)) ->
source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.duration
(of type{float}
, which defaults to0.5
): Duration of the window (in seconds). A value <= 0, means that computation should not be performed.(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.peak
(of type() -> float
): Current value for the peak volume.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
peak.stereo
Get current peak volume of the source. Returns the source with a
method peak
to compute the current peak volume of the
source, with 0.0 <= peak volume <= 1.0
.
Type:
(?id : string?, ?duration : {float}, source(audio=pcm(stereo), 'a)) ->
source(audio=pcm(stereo), 'a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.duration
(of type{float}
, which defaults to0.5
): Duration of the window (in seconds). A value <= 0, means that computation should not be performed.(unlabeled)
(of typesource(audio=pcm(stereo), 'a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.peak
(of type() -> float * float
): Current value for the peak volume.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
pipe
Process audio signal through a given process stdin/stdout.
Type:
(?id : string?, ?buffer : float, ?data_length : int?, ?max : float,
process : string, ?replay_delay : float?, ?restart : bool,
?restart_on_error : bool, source(audio=pcm('a), 'b)) ->
source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.buffer
(of typefloat
, which defaults to1.
): Duration of the pre-buffered data.data_length
(of typeint?
, which defaults tonull
): Length passed in the WAV data chunk. Data is streamed so no the consuming program should process it as it comes. Some program operate better when this value is set to0
, some other when it is set to the maximum length allowed by the WAV specs. Use any negative value to set to maximum length.max
(of typefloat
, which defaults to10.
): Maximum duration of the buffered data.process
(of typestring
): Process used to pipe data to.replay_delay
(of typefloat?
, which defaults tonull
): Replay track marks and metadata from the input source on the output after a given delay. Ifnull
(default) close and flush the process on each track and metadata to get an exact timing. This parameter is typically used when integrating withstereotool
.restart
(of typebool
, which defaults totrue
): Restart process when exited.restart_on_error
(of typebool
, which defaults totrue
): Restart process when exited with error.(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
replaygain
Amplify source tracks according to replaygain metadata. This operator
does not compute itself the replaygain: you can use either
enable_replaygain_metadata
or the replaygain:
protocol for this.
Type:
(?id : string?, ?ebu_r128 : bool, source(audio=pcm('a), 'b)) ->
source(audio=pcm('a), 'b)
where 'b is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.ebu_r128
(of typebool
, which defaults totrue
): Also amplify according to EBU R128 tags.(unlabeled)
(of typesource(audio=pcm('a), 'b) where 'b is a set of tracks to be muxed into a source
): Source to be amplified.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
rms
Get current RMS volume of the source. Returns the source with a
method rms
to compute the current RMS volume of the source,
with 0.0 <= RMS volume <= 1.0
.
Type:
(?id : string?, ?duration : {float}, source(audio=pcm('a), 'b)) ->
source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.duration
(of type{float}
, which defaults to0.5
): Duration of the window (in seconds). A value <= 0, means that computation should not be performed.(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.rms
(of type() -> float
): Current value for the RMS volume.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
rms.stereo
Get current RMS volume of the source. Returns the source with a
method rms
to compute the current RMS volume of the source,
with 0.0 <= RMS volume <= 1.0
.
Type:
(?id : string?, ?duration : {float}, source(audio=pcm(stereo), 'a)) ->
source(audio=pcm(stereo), 'a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.duration
(of type{float}
, which defaults to0.5
): Duration of the window (in seconds). A value <= 0, means that computation should not be performed.(unlabeled)
(of typesource(audio=pcm(stereo), 'a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.rms
(of type() -> float * float
): Current value for the RMS volume.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
sine.detect
Detect sine waves.
Type:
(?id : string?, ?bands : int, ?debug : {bool}, ?duration : {float},
?smoothing : {float}, ?threshold : {float}, [float], source(audio=pcm('a),
'b), ((float) -> unit)) -> source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.bands
(of typeint
, which defaults to1024
): Number of frequency bands.debug
(of type{bool}
, which defaults tofalse
): Show internal values on standard output in order to fine-tune parameters: band number, band frequency, detected intensity and smoothed intensity.duration
(of type{float}
, which defaults to0.5
): Duration for detecting a tone.smoothing
(of type{float}
, which defaults to0.01
): Smoothing time (in seconds) for band indensity (the higher, the less sensitive we are to local variations, but the more time we take to detect a band).threshold
(of type{float}
, which defaults to50.
): Threshold for detecting a band.(unlabeled)
(of type[float]
): List of frequencies to detect.(unlabeled)
(of typesource(audio=pcm('a), 'b)
): Source on which sines should be detected.(unlabeled)
(of type(float) -> unit
): Function called with detected frequency as argument.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
soundtouch
Change the rate, the tempo or the pitch of the sound.
Type:
(?id : string?, ?pitch : {float}, ?rate : {float}, ?tempo : {float},
source(audio=pcm('a), 'b)) -> source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.pitch
(of type{float}
, which defaults to1.
)rate
(of type{float}
, which defaults to1.
)tempo
(of type{float}
, which defaults to1.
)(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
This function is experimental.
source.replaygain.compute
Compute the ReplayGain of the source. Data is accumulated until the
gain
method is called, i.e. the gain is computed
after the source has been played..
Type:
(?id : string?, source(audio=pcm('a), 'b)) -> source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.gain
(of type() -> float
): Suggested gain (in dB).id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.peak
(of type() -> float
): Peak sample.remaining
(of type() -> float
): Estimation of remaining time in the current track.reset
(of type() -> unit
): Reset ReplayGain computation.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
stereo.ms.decode
Decode mid+side stereo (M/S) to left+right stereo.
Type:
(?id : string?, ?width : float, source(audio=pcm(stereo), 'a)) ->
source(audio=pcm(stereo), 'a)
where 'a is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults to"stereo.ms.decode"
): Force the value of the track ID.width
(of typefloat
, which defaults to1.
): Width of the stereo field.(unlabeled)
(of typesource(audio=pcm(stereo), 'a) where 'a is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
stereo.ms.encode
Encode left+right stereo to mid+side stereo (M/S).
Type:
(?id : string?, source(audio=pcm(stereo), 'a)) -> source(audio=pcm(stereo),
'a) where 'a is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults to"stereo.ms.encode"
): Force the value of the track ID.(unlabeled)
(of typesource(audio=pcm(stereo), 'a) where 'a is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
stereo.pan
Pan a stereo sound.
Type:
(?id : string?, ?pan : {float}, ?field : {float}, source(audio=pcm(stereo),
'a)) -> source(audio=pcm(stereo), 'a)
where 'a is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults to"stereo.pan"
): Force the value of the track ID.pan
(of type{float}
, which defaults to0.
): Pan ranges between -1 and 1.field
(of type{float}
, which defaults to90.
): Field width in degrees (between 0 and 90).(unlabeled)
(of typesource(audio=pcm(stereo), 'a) where 'a is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
stereo.width
Spacializer which allows controlling the width of the signal.
Type:
(?id : string?, ?{float}, source(audio=pcm(stereo), 'a)) ->
source(audio=pcm(stereo), 'a)
where 'a is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults to"stereo.width"
)(unlabeled)
(of type{float}
, which defaults to0.
): Width of the signal (-1: mono, 0.: original, 1.: wide stereo).(unlabeled)
(of typesource(audio=pcm(stereo), 'a) where 'a is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
stereotool
Process an audio source using stereotool
Type:
(?id : string?, library_file : string, ?license_key : string?,
?preset : string?, ?load_type : string, source(audio=pcm('a), 'b)) ->
source(audio=pcm('a))
Arguments:
id
(of typestring?
, which defaults to"stereotool"
): Force the value of the track ID.library_file
(of typestring
): Path to the shared library file.license_key
(of typestring?
, which defaults tonull
)preset
(of typestring?
, which defaults tonull
): Path to a preset file to load when initializing the operator.load_type
(of typestring
, which defaults to"totalinit"
): Load type for preset. One of: “totalinit”, “all_settings”, “audiofm”, “audio”, “processing”, “repair”, “repair_no_pnr” or “sublevel_pnr”.(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
api_version
(of type() -> int
): API version.buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.latency
(of type() -> float
): Get the operator’s latency.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.software_version
(of type() -> int
): Software version.time
(of type() -> float
): Get a source’s time, based on its assigned clock.unlincensed_used_features
(of type() -> string?
): Check if the license is valid for the current settings.valid_license
(of type() -> bool
): Check if the license is valid for the current settings.
stretch
Slow down or accelerate an audio stream by stretching (sounds lower) or squeezing it (sounds higher).
Type:
(?id : string?, ratio : {float}, source(audio=pcm('a), 'b)) ->
source(audio=pcm('a))
Arguments:
id
(of typestring?
, which defaults to"stretch"
): Force the value of the track ID.ratio
(of type{float}
): A value higher than 1 means slowing down.(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
Source / Conversion
ffmpeg.decode.audio
Decode a source’s audio content
Type:
(?id : string?, source(audio=ffmpeg.copy('a), 'b)) -> source(audio=pcm('c))
Arguments:
id
(of typestring?
, which defaults to"ffmpeg.decode.audio"
)(unlabeled)
(of typesource(audio=ffmpeg.copy('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
ffmpeg.decode.audio_video
Decode a source’s audio and video content
Type:
(?id : string?, source(audio=ffmpeg.copy('b), video=ffmpeg.copy('a))) ->
source(audio=pcm('c), video=canvas('d))
Arguments:
id
(of typestring?
, which defaults to"ffmpeg.decode.audio_video"
)(unlabeled)
(of typesource(audio=ffmpeg.copy('b), video=ffmpeg.copy('a))
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
ffmpeg.decode.video
Decode a source’s video content
Type:
(?id : string?, source(video=ffmpeg.copy('a), 'b)) ->
source(video=canvas('c))
Arguments:
id
(of typestring?
, which defaults to"ffmpeg.decode.video"
)(unlabeled)
(of typesource(video=ffmpeg.copy('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
ffmpeg.encode.audio
Encode a source’s audio content
Type:
(?id : string?, format(audio=pcm('a), 'b), source(audio=pcm('a), 'c)) ->
source(audio=ffmpeg.copy('d))
Arguments:
id
(of typestring?
, which defaults to"ffmpeg.encode.audio"
)(unlabeled)
(of typeformat(audio=pcm('a), 'b)
)(unlabeled)
(of typesource(audio=pcm('a), 'c)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
ffmpeg.encode.audio_video
Encode a source’s audio and video content
Type:
(?id : string?, format(audio=pcm('a), video=canvas('b), 'c),
source(audio=pcm('a), video=canvas('b))) -> source(audio=ffmpeg.copy('d),
video=ffmpeg.copy('e))
Arguments:
id
(of typestring?
, which defaults to"ffmpeg.encode.audio_video"
)(unlabeled)
(of typeformat(audio=pcm('a), video=canvas('b), 'c)
)(unlabeled)
(of typesource(audio=pcm('a), video=canvas('b))
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
ffmpeg.encode.video
Encode a source’s video content
Type:
(?id : string?, format(video=canvas('a), 'b), source(video=canvas('a), 'c)) ->
source(video=ffmpeg.copy('d))
Arguments:
id
(of typestring?
, which defaults to"ffmpeg.encode.video"
)(unlabeled)
(of typeformat(video=canvas('a), 'b)
)(unlabeled)
(of typesource(video=canvas('a), 'c)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
ffmpeg.raw.decode.audio
Decode a source’s audio content
Type:
(?id : string?, source(audio=ffmpeg.audio.raw('a), 'b)) ->
source(audio=pcm('c))
Arguments:
id
(of typestring?
, which defaults to"ffmpeg.raw.decode.audio"
)(unlabeled)
(of typesource(audio=ffmpeg.audio.raw('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
ffmpeg.raw.decode.audio_video
Decode a source’s audio and video content
Type:
(?id : string?, source(audio=ffmpeg.audio.raw('b),
video=ffmpeg.video.raw('a))) -> source(audio=pcm('c), video=canvas('d))
Arguments:
id
(of typestring?
, which defaults to"ffmpeg.raw.decode.audio_video"
)(unlabeled)
(of typesource(audio=ffmpeg.audio.raw('b), video=ffmpeg.video.raw('a))
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
ffmpeg.raw.decode.video
Decode a source’s video content
Type:
(?id : string?, source(video=ffmpeg.video.raw('a), 'b)) ->
source(video=canvas('c))
Arguments:
id
(of typestring?
, which defaults to"ffmpeg.raw.decode.video"
)(unlabeled)
(of typesource(video=ffmpeg.video.raw('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
ffmpeg.raw.encode.audio
Encode a source’s audio content
Type:
(?id : string?, format(audio=ffmpeg.audio.raw('a), 'b), source(audio=pcm('c),
'd)) -> source(audio=ffmpeg.audio.raw('a))
Arguments:
id
(of typestring?
, which defaults to"ffmpeg.raw.encode.audio"
)(unlabeled)
(of typeformat(audio=ffmpeg.audio.raw('a), 'b)
)(unlabeled)
(of typesource(audio=pcm('c), 'd)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
ffmpeg.raw.encode.audio_video
Encode a source’s audio and video content
Type:
(?id : string?, format(audio=ffmpeg.audio.raw('a),
video=ffmpeg.video.raw('b), 'c), source(audio=pcm('e), video=canvas('d))) ->
source(audio=ffmpeg.audio.raw('a), video=ffmpeg.video.raw('b))
Arguments:
id
(of typestring?
, which defaults to"ffmpeg.raw.encode.audio_video"
)(unlabeled)
(of typeformat(audio=ffmpeg.audio.raw('a), video=ffmpeg.video.raw('b), 'c)
)(unlabeled)
(of typesource(audio=pcm('e), video=canvas('d))
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
ffmpeg.raw.encode.video
Encode a source’s video content
Type:
(?id : string?, format(video=ffmpeg.video.raw('a), 'b),
source(video=canvas('c), 'd)) -> source(video=ffmpeg.video.raw('a))
Arguments:
id
(of typestring?
, which defaults to"ffmpeg.raw.encode.video"
)(unlabeled)
(of typeformat(video=ffmpeg.video.raw('a), 'b)
)(unlabeled)
(of typesource(video=canvas('c), 'd)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
mean
Produce mono audio by taking the mean of all audio channels.
Type:
(?id : string?, ?normalize : bool, source(audio=pcm('a), 'b)) ->
source(audio=pcm(mono), 'b)
where 'b is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults to"mean"
): Force the value of the track ID.normalize
(of typebool
, which defaults totrue
): Divide the output volume by the number of channels.(unlabeled)
(of typesource(audio=pcm('a), 'b) where 'b is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
stereo
Convert any pcm audio source into a stereo source.
Type:
(?id : string?, source(audio=pcm('a), 'b)) -> source(audio=pcm(stereo), 'b)
where 'b is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults to"stereo"
)(unlabeled)
(of typesource(audio=pcm('a), 'b) where 'b is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
stereo.left
Extract the left channel of a stereo source
Type:
(?id : string?, source(audio=pcm(stereo), 'a)) -> source(audio=pcm(mono), 'a)
where 'a is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults to"stereo.left"
)(unlabeled)
(of typesource(audio=pcm(stereo), 'a) where 'a is a set of tracks to be muxed into a source
): Source to extract from
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
stereo.right
Extract the right channel of a stereo source
Type:
(?id : string?, source(audio=pcm(stereo), 'a)) -> source(audio=pcm(mono), 'a)
where 'a is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults to"stereo.right"
)(unlabeled)
(of typesource(audio=pcm(stereo), 'a) where 'a is a set of tracks to be muxed into a source
): Source to extract from
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
swap
Swap two channels of a stereo source.
Type:
(?string?, source(audio=pcm(stereo), 'a)) -> source(audio=pcm(stereo), 'a)
where 'a is a set of tracks to be muxed into a source
Arguments:
(unlabeled)
(of typestring?
, which defaults to"swap"
)(unlabeled)
(of typesource(audio=pcm(stereo), 'a) where 'a is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
track.audio.stereo.left
Extract the left channel of a stereo track
Type:
(?id : string?, pcm(stereo)) -> pcm(mono)
Arguments:
id
(of typestring?
, which defaults to"track.audio.stereo.left"
)(unlabeled)
(of typepcm(stereo)
): Track to extract from
track.audio.stereo.right
Extract the right channel of a stereo track
Type:
(?id : string?, pcm(stereo)) -> pcm(mono)
Arguments:
id
(of typestring?
, which defaults to"track.audio.stereo.right"
)(unlabeled)
(of typepcm(stereo)
): Track to extract from
Source / FFmpeg filter
ffmpeg.filter.audio.input
Attach an audio track to a filter’s input
Type:
(?id : string?, ?pass_metadata : bool, ffmpeg.filter.graph,
ffmpeg.audio.raw('a)) -> ffmpeg.filter.audio
Arguments:
id
(of typestring?
, which defaults tonull
)pass_metadata
(of typebool
, which defaults totrue
): Pass liquidsoap’s metadata to this stream(unlabeled)
(of typeffmpeg.filter.graph
)(unlabeled)
(of typeffmpeg.audio.raw('a)
)
ffmpeg.filter.create
Configure and launch a filter graph
Type:
(((ffmpeg.filter.graph) -> 'a)) -> 'a
Arguments:
(unlabeled)
(of type(ffmpeg.filter.graph) -> 'a
)
ffmpeg.filter.video.input
Attach a video track to a filter’s input
Type:
(?id : string?, ?pass_metadata : bool, ffmpeg.filter.graph,
ffmpeg.video.raw('a)) -> ffmpeg.filter.video
Arguments:
id
(of typestring?
, which defaults tonull
)pass_metadata
(of typebool
, which defaults totrue
): Pass liquidsoap’s metadata to this stream(unlabeled)
(of typeffmpeg.filter.graph
)(unlabeled)
(of typeffmpeg.video.raw('a)
)
Source / Fade
cross
Cross operator, allowing the composition of the n last seconds of a track with the beginning of the next track, using a transition function depending on the relative power of the signal before and after the end of track.
Type:
(?id : string?, ?conservative : bool, ?duration : {float}, ?minimum : float,
?override_duration : string, ?persist_override : bool, ?width : float,
((
{
db_level : float,
metadata : [string * string],
source : source(audio=pcm('a),
'b)
},
{
db_level : float,
metadata : [string * string],
source : source(audio=pcm('a),
'b)
}) -> source(audio=pcm('a), 'b)),
source(audio=pcm('a), 'b)) -> source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.conservative
(of typebool
, which defaults totrue
): Do not trust remaining time estimations, always buffering data in advance. This avoids being tricked by skips, either manual or caused by blank.skip().duration
(of type{float}
, which defaults to5.
): Duration (in seconds) of buffered data from each track that is used to compute the transition between tracks.minimum
(of typefloat
, which defaults to-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 a negative default, transitions always occur.override_duration
(of typestring
, which defaults to"liq_cross_duration"
): Metadata field which, if present and containing a float, overrides the ‘duration’ parameter for current track.persist_override
(of typebool
, which defaults tofalse
): Keep duration override on track change.width
(of typefloat
, which defaults to2.
): Width of the power computation window.(unlabeled)
(of type( { db_level : float, metadata : [string * string], source : source(audio=pcm('a), 'b) }, { db_level : float, metadata : [string * string], source : source(audio=pcm('a), 'b) }) -> source(audio=pcm('a), 'b)
): Transition function, composing from the end of a track and the next track. The sources corresponding to the two tracks are decorated with fields indicating the power of the signal before and after the transition (power
), and the metadata (metadata
).(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.cross_duration
(of type() -> float
): Get the current crossfade duration.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
cross.simple
Simple transition for crossfade
Type:
(?fade_in : float, ?fade_out : float, source(audio=pcm('a), 'b),
source(audio=pcm('a), 'b)) -> source(audio=pcm('a), 'b)
where
'b is a set of tracks to be muxed into a source and a set of internal tracks
Arguments:
fade_in
(of typefloat
, which defaults to3.
): Fade-in duration, if any.fade_out
(of typefloat
, which defaults to3.
): Fade-out duration, if any.(unlabeled)
(of typesource(audio=pcm('a), 'b) where 'b is a set of tracks to be muxed into a source and a set of internal tracks
): Ending track(unlabeled)
(of typesource(audio=pcm('a), 'b) where 'b is a set of tracks to be muxed into a source and a set of internal tracks
): Starting track
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
cross.smart
Smart transition for crossfade
Type:
(?log : ((string) -> unit), ?fade_in : float, ?fade_out : float,
?default : ((source(audio=pcm('a), 'b), source(audio=pcm('a), 'b)) ->
source(audio=pcm('a), 'b)),
?high : float, ?medium : float, ?margin : float, 'c
.{
db_level : float,
metadata : [string * string],
source : source(audio=pcm('a),
'b)
}, 'd
.{
db_level : float,
metadata : [string * string],
source : source(audio=pcm('a),
'b)
}) -> source(audio=pcm('a), 'b)
where
'b is a set of tracks to be muxed into a source and a set of internal tracks
Arguments:
log
(of type(string) -> unit
, which defaults to<fun>
): Default loggerfade_in
(of typefloat
, which defaults to3.
): Fade-in duration, if any.fade_out
(of typefloat
, which defaults to3.
): Fade-out duration, if any.default
(of type(source(audio=pcm('a), 'b), source(audio=pcm('a), 'b)) -> source(audio=pcm('a), 'b) where 'b is a set of tracks to be muxed into a source and a set of internal tracks
, which defaults to<fun>
): Smart crossfade: transition used when no rule applies (default: sequence).high
(of typefloat
, which defaults to-15.
): Value, in dB, for loud sound level.medium
(of typefloat
, which defaults to-32.
): Value, in dB, for medium sound level.margin
(of typefloat
, which defaults to4.
): Margin to detect sources that have too different sound level for crossing.(unlabeled)
(of type'c .{ db_level : float, metadata : [string * string], source : source(audio=pcm('a), 'b) } where 'b is a set of tracks to be muxed into a source and a set of internal tracks
): Ending track(unlabeled)
(of type'd .{ db_level : float, metadata : [string * string], source : source(audio=pcm('a), 'b) } where 'b is a set of tracks to be muxed into a source and a set of internal tracks
): Starting track
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
crossfade
Crossfade between tracks, taking the respective volume levels into account in the choice of the transition.
Type:
(?id : string?, ?duration : float, ?override_duration : string,
?persist_override : bool, ?fade_in : float, ?fade_out : float,
?smart : bool,
?default : ((source(audio=pcm('a), 'b), source(audio=pcm('a), 'b)) ->
source(audio=pcm('a), 'b)),
?high : float, ?medium : float, ?margin : float, ?deduplicate : bool,
?minimum : float, ?width : float, ?conservative : bool,
source(audio=pcm('a), 'b)) -> source(audio=pcm('a), 'b)
where
'b is a set of tracks to be muxed into a source and a set of internal tracks
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.duration
(of typefloat
, which defaults to5.
): Duration (in seconds) of buffered data from each track that is used to compute the transition between tracks.override_duration
(of typestring
, which defaults to"liq_cross_duration"
): Metadata field which, if present and containing a float, overrides the ‘duration’ parameter for current track.persist_override
(of typebool
, which defaults tofalse
): Keep duration override on track change.fade_in
(of typefloat
, which defaults to3.
): Fade-in duration, if any.fade_out
(of typefloat
, which defaults to3.
): Fade-out duration, if any.smart
(of typebool
, which defaults tofalse
): Enable smart crossfadingdefault
(of type(source(audio=pcm('a), 'b), source(audio=pcm('a), 'b)) -> source(audio=pcm('a), 'b) where 'b is a set of tracks to be muxed into a source and a set of internal tracks
, which defaults to<fun>
): Smart crossfade: transition used when no rule applies (default: sequence).high
(of typefloat
, which defaults to-15.
): Smart crossfade: value, in dB, for loud sound level.medium
(of typefloat
, which defaults to-32.
): Smart crossfade: value, in dB, for medium sound level.margin
(of typefloat
, which defaults to4.
): Smart crossfade: margin to detect sources that have too different sound level for crossing.deduplicate
(of typebool
, which defaults totrue
): Crossfade transitions can generate duplicate metadata. Whentrue
, the operator removes duplicate metadata from the returned source.minimum
(of typefloat
, which defaults to-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 a negative default, transitions always occur.width
(of typefloat
, which defaults to2.
): Width of the volume analysis window.conservative
(of typebool
, which defaults totrue
): Always prepare for a premature end-of-track.(unlabeled)
(of typesource(audio=pcm('a), 'b) where 'b is a set of tracks to be muxed into a source and a set of internal tracks
): The input source.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.cross_duration
(of type() -> float
):duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
fade.in
Fade the beginning of tracks.
Type:
(?id : string, ?duration : float, ?override_duration : string,
?override_type : string, ?persist_overrides : bool, ?track_sensitive : bool,
?type : string, source(audio=pcm('a), 'b)) -> source(audio=pcm('a), 'b)
where 'b is a set of tracks to be muxed into a source
Arguments:
id
(of typestring
, which defaults to"fade.in"
): Force the value of the source ID.duration
(of typefloat
, which defaults to3.
): Duration of the fading. This value can be set on a per-file basis using the metadata field passed as override.override_duration
(of typestring
, which defaults to"liq_fade_in"
): Metadata field which, if present and containing a float, overrides the ‘duration’ parameter for the current track.override_type
(of typestring
, which defaults to"liq_fade_type"
): Metadata field which, if present and correct, overrides the ‘type’ parameter for the current track.persist_overrides
(of typebool
, which defaults tofalse
): Keep duration and type overrides on track change.track_sensitive
(of typebool
, which defaults totrue
): Be track sensitive (iffalse
we only fade in once at the beginning of the track).type
(of typestring
, which defaults to"lin"
): Fader shape (lin|sin|log|exp): linear, sinusoidal, logarithmic or exponential.(unlabeled)
(of typesource(audio=pcm('a), 'b) where 'b is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fade_duration
(of type() -> float
):fade_type
(of type() -> string
):fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
fade.out
Fade the end of tracks.
Type:
(?id : string, ?duration : float, ?override_duration : string,
?override_type : string, ?persist_overrides : bool, ?track_sensitive : bool,
?type : string, source(audio=pcm('a), 'b)) -> source(audio=pcm('a), 'b)
where 'b is a set of tracks to be muxed into a source
Arguments:
id
(of typestring
, which defaults to"fade.out"
): Force the value of the source ID.duration
(of typefloat
, which defaults to3.
): Duration of the fading. This value can be set on a per-file basis using the metadata field passed as override.override_duration
(of typestring
, which defaults to"liq_fade_out"
): Metadata field which, if present and containing a float, overrides the ‘duration’ parameter for the current track.override_type
(of typestring
, which defaults to"liq_fade_type"
): Metadata field which, if present and correct, overrides the ‘type’ parameter for the current track.persist_overrides
(of typebool
, which defaults tofalse
): Keep duration and type overrides on track change.track_sensitive
(of typebool
, which defaults totrue
): Be track sensitive (iffalse
we only fade ou once at the beginning of the track).type
(of typestring
, which defaults to"lin"
): Fader shape (lin|sin|log|exp): linear, sinusoidal, logarithmic or exponential.(unlabeled)
(of typesource(audio=pcm('a), 'b) where 'b is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fade_duration
(of type() -> float
):fade_type
(of type() -> string
):fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
fade.skip
Fade when the metadata trigger is received and then skip.
Type:
(?id : string, ?duration : float, ?override_duration : string,
?override_type : string, ?persist_overrides : bool, ?override_skip : string,
?type : string, source(audio=pcm('a), 'b)) -> source(audio=pcm('a), 'b)
where 'b is a set of tracks to be muxed into a source
Arguments:
id
(of typestring
, which defaults to"fade.skip"
): Force the value of the source ID.duration
(of typefloat
, which defaults to5.
): Duration of the fading. This value can be set on a per-file basis using the metadata field passed as override.override_duration
(of typestring
, which defaults to"liq_fade_skip"
): Metadata field which, if present and containing a float, overrides the ‘duration’ parameter for the current track.override_type
(of typestring
, which defaults to"liq_fade_type"
): Metadata field which, if present and correct, overrides the ‘type’ parameter for the current track.persist_overrides
(of typebool
, which defaults tofalse
): Keep duration and type overrides on track change.override_skip
(of typestring
, which defaults to"liq_skip_meta"
): Metadata field which, when present and set to “true”, will trigger the fadetype
(of typestring
, which defaults to"lin"
): Fader shape (lin|sin|log|exp): linear, sinusoidal, logarithmic or exponential.(unlabeled)
(of typesource(audio=pcm('a), 'b) where 'b is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fade_duration
(of type() -> float
):fade_type
(of type() -> string
):fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
mkfade
Make a fade function based on a source’s clock.
Type:
(?type : string, ?start : float, ?stop : float, ?duration : float,
?on_done : (() -> unit), source('a)) -> () -> float
Arguments:
type
(of typestring
, which defaults to"lin"
): Fade shape. One of: “sin”, “exp”, “log”, “lin”start
(of typefloat
, which defaults to0.
): Start value.stop
(of typefloat
, which defaults to1.
): Stop value.duration
(of typefloat
, which defaults to3.
): Duration in seconds.on_done
(of type() -> unit
, which defaults to{()}
): Function to execute when the fade is finished(unlabeled)
(of typesource('a)
)
Source / Input
blank
Produce silence and blank images.
Type:
(?id : string?, ?duration : float) -> source('a)
where 'a is a set of internal tracks
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.duration
(of typefloat
, which defaults to-1.
): Duration of blank tracks in seconds, Negative value means forever.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
input
Input an audio stream using the default operator.
Type:
(?id : string?, ?start : bool, ?on_start : (() -> unit),
?on_stop : (() -> unit), ?fallible : bool) -> source(audio=pcm('A))
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.start
(of typebool
, which defaults totrue
): Automatically start outputting whenever possible. Iftrue
, an infallible (normal) output will start outputting as soon as it is created, and a fallible output will (re)start as soon as its source becomes available for streaming.on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when outputting starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when outputting stops.fallible
(of typebool
, which defaults tofalse
): Allow the child source to fail, in which case the output will be (temporarily) stopped.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
input.alsa
Stream from an ALSA input device.
Type:
(?id : string?, ?bufferize : bool, ?clock_safe : bool, ?device : string,
?fallible : bool, ?on_start : (() -> unit), ?on_stop : (() -> unit),
?start : bool) -> source(audio=pcm('a))
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.bufferize
(of typebool
, which defaults totrue
): Bufferize inputclock_safe
(of typebool
, which defaults totrue
): Force the use of a dedicated clockdevice
(of typestring
, which defaults to"default"
): Alsa device to usefallible
(of typebool
, which defaults tofalse
): Allow the source to fail. If set tofalse
,start
must betrue
andstop
method raises an error.on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when input starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when input stops.start
(of typebool
, which defaults totrue
): Start input as soon as it is available.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
input.external.avi
Stream data from an external application.
Type:
(?id : string?, ?buffer : float, ?max : float, ?restart : bool,
?restart_on_error : bool, {string}) -> source(audio=pcm('a),
video=canvas('b))
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.buffer
(of typefloat
, which defaults to1.
): Duration of the pre-buffered data.max
(of typefloat
, which defaults to10.
): Maximum duration of the buffered data.restart
(of typebool
, which defaults totrue
): Restart process when exited.restart_on_error
(of typebool
, which defaults tofalse
): Restart process when exited with error.(unlabeled)
(of type{string}
): Command to execute.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
This function is experimental.
input.external.rawaudio
Stream raw PCM data (interleaved signed 16 bits little endian integers) from an external application.
Type:
(?id : string?, ?buffer : float, ?channels : int, ?max : float,
?restart : bool, ?restart_on_error : bool, ?samplerate : int, {string}) ->
source(audio=pcm('a))
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.buffer
(of typefloat
, which defaults to2.
): Duration of the pre-buffered data.channels
(of typeint
, which defaults to2
): Number of channels.max
(of typefloat
, which defaults to10.
): Maximum duration of the buffered data.restart
(of typebool
, which defaults totrue
): Restart process when exited.restart_on_error
(of typebool
, which defaults tofalse
): Restart process when exited with error.samplerate
(of typeint
, which defaults to44100
): Samplerate.(unlabeled)
(of type{string}
): Command to execute.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
input.external.rawvideo
Stream data from an external application.
Type:
(?id : string?, ?buffer : float, ?max : float, ?restart : bool,
?restart_on_error : bool, {string}) -> source(video=canvas('a))
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.buffer
(of typefloat
, which defaults to1.
): Duration of the pre-buffered data.max
(of typefloat
, which defaults to10.
): Maximum duration of the buffered data.restart
(of typebool
, which defaults totrue
): Restart process when exited.restart_on_error
(of typebool
, which defaults tofalse
): Restart process when exited with error.(unlabeled)
(of type{string}
): Command to execute.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
This function is experimental.
input.external.wav
Stream WAV data from an external application.
Type:
(?id : string?, ?buffer : float, ?max : float, ?restart : bool,
?restart_on_error : bool, {string}) -> source(audio=pcm('a))
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.buffer
(of typefloat
, which defaults to2.
): Duration of the pre-buffered data.max
(of typefloat
, which defaults to10.
): Maximum duration of the buffered data.restart
(of typebool
, which defaults totrue
): Restart process when exited.restart_on_error
(of typebool
, which defaults tofalse
): Restart process when exited with error.(unlabeled)
(of type{string}
): Command to execute.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
input.ffmpeg
Create a stream using ffmpeg
Type:
(?id : string?, ?clock_safe : bool, ?debug : bool,
?deduplicate_metadata : bool, ?float_args : [string * float],
?format : string?, ?int_args : [string * int], ?max_buffer : float,
?metadata_filter : (([string * string]) -> [string * string])?,
?new_track_on_metadata : bool, ?on_connect : (() -> unit),
?on_disconnect : (() -> unit),
?on_error : ((error
.{
kind : string,
message : string,
trace : [
{
position_end :
{
character_offset : int,
filename : string,
line_number : int
},
position_start :
{
character_offset : int,
filename : string,
line_number : int
},
to_string : (?prefix : string) -> string
}]
}) -> unit),
?on_start : (() -> unit), ?on_stop : (() -> unit), ?poll_delay : float,
?self_sync : {bool}, ?start : bool, ?string_args : [string * string],
?trim_url : bool, {string}) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.clock_safe
(of typebool
, which defaults tofalse
): Force the use of a dedicated clockdebug
(of typebool
, which defaults tofalse
): Run in debugging mode, not catching some exceptions.deduplicate_metadata
(of typebool
, which defaults totrue
): Prevent duplicated metadata.float_args
(of type[string * float]
, which defaults to[]
)format
(of typestring?
, which defaults tonull
): Force a specific input format. Autodetected when passed a null argumentint_args
(of type[string * int]
, which defaults to[]
)max_buffer
(of typefloat
, which defaults to5.
): Maximum uration of buffered datametadata_filter
(of type(([string * string]) -> [string * string])?
, which defaults tonull
): Metadata filter function. Returned metadata are set a metadata. Default: filterid3v2_priv
metadata.new_track_on_metadata
(of typebool
, which defaults totrue
): Treat new metadata as new track.on_connect
(of type() -> unit
, which defaults to{()}
): Function to execute when a source is connected.on_disconnect
(of type() -> unit
, which defaults to{()}
): Function to execute when a source is disconnectedon_error
(of type(error .{ kind : string, message : string, trace : [ { position_end : {character_offset : int, filename : string, line_number : int }, position_start : {character_offset : int, filename : string, line_number : int }, to_string : (?prefix : string) -> string }] }) -> unit
, which defaults tofun (_) -> ()
): Callback executed when an error occurs.on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when input starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when input stops.poll_delay
(of typefloat
, which defaults to2.
): Polling delay when trying to connect to the stream.self_sync
(of type{bool}
, which defaults tofalse
): Should the source control its own timing? Set totrue
if you are having synchronization issues. Should befalse
for most typical cases.start
(of typebool
, which defaults totrue
): Start input as soon as it is available.string_args
(of type[string * string]
, which defaults to[]
)trim_url
(of typebool
, which defaults totrue
): Trim input URL.(unlabeled)
(of type{string}
): URL to decode.
Methods:
buffer_length
(of type() -> float
): Get the buffer’s length in seconds.buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.set_url
(of type({string}) -> unit
): Set the source’s url.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.status
(of type() -> string
): Return the current status of the source, either “stopped” (the source isn’t trying to relay the HTTP stream), “starting” (polling task is about to begin) “polling” (attempting to connect to the HTTP stream), “connected” (connected to , buffering or playing back the stream) or “stopping” (source is stopping). stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.url
(of type() -> string
): Return the source’s current url.
input.harbor
Create a source that receives a http/icecast stream and forwards it as a stream.
Type:
(?id : string?,
?auth : (({address : string, password : string, user : string}) -> bool)?,
?buffer : float, ?debug : bool, ?dumpfile : string?, ?icy : bool,
?icy_metadata_charset : string?, ?logfile : string?, ?max : float,
?metadata_charset : string?, ?on_connect : (([string * string]) -> unit),
?on_disconnect : (() -> unit), ?password : string, ?port : int,
?replay_metadata : bool, ?timeout : float, ?transport : http_transport,
?user : string, string) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.auth
(of type(({address : string, password : string, user : string}) -> bool)?
, which defaults tonull
): Authentication function. Receives a record with:user
,password
andaddress
(client network address) and returnstrue
if the user should be granted access for this login. Override any other method if used.buffer
(of typefloat
, which defaults to12.
): Duration of the pre-buffered data (in seconds). Default value is set to make it possible to usecrossfade
transitions withinput.harbor
. You might be able to reduce it but, in this case, make sure to not use the operator withcrossfade
or make sure that it has enough buffered data for it.debug
(of typebool
, which defaults tofalse
): Run in debugging mode by not catching some exceptions.dumpfile
(of typestring?
, which defaults tonull
): Dump stream to file, for debugging purpose. Disabled if null.icy
(of typebool
, which defaults tofalse
): Enable ICY (shoutcast) protocol.icy_metadata_charset
(of typestring?
, which defaults tonull
): ICY (shoutcast) metadata charset. Guessed if null. Default for shoutcast is ISO-8859-1. Set to that value if all your clients send metadata using this charset and automatic detection is not working for you.logfile
(of typestring?
, which defaults tonull
): Log buffer status to file, for debugging purpose. Disabled if null.max
(of typefloat
, which defaults to20.
): Maximum duration of the buffered data (in seconds).metadata_charset
(of typestring?
, which defaults tonull
): Metadata charset for non-ICY (shoutcast) source protocols. Guessed if null.on_connect
(of type([string * string]) -> unit
, which defaults tofun (_) -> ()
): Function to execute when a source is connected. Its receives the list of headers, of the form: (on_disconnect
(of type() -> unit
, which defaults to{()}
): Functions to execute when a source is disconnectedpassword
(of typestring
, which defaults to"hackme"
): Source password.port
(of typeint
, which defaults to8005
): Port used to connect to the source.replay_metadata
(of typebool
, which defaults tofalse
): Replay last known metadata when switching back to this source. This helps when source has dropped due to temporary connection issues.timeout
(of typefloat
, which defaults to30.
): Timeout for source connectionn.transport
(of typehttp_transport
, which defaults to<unix_transport>
): Http transport. Usehttp.transport.ssl
orhttp.transport.secure_transport
, when available, to enable HTTPS outputuser
(of typestring
, which defaults to"source"
): Source user.(unlabeled)
(of typestring
): Mountpoint to look for.
Methods:
buffer_length
(of type() -> float
): Length of the buffer (in seconds).buffered
(of type() -> [string * float]
): Length of buffered data.connected_client
(of type() -> string?
): Returns the address of the client currently connected, if there is one.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.status
(of type() -> string
): Current status of the input.stop
(of type() -> unit
): Disconnect the client currently connected to the harbor. Does nothing if no client is connected.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
input.hls
Play an HLS stream.
Type:
(?id : string?, {string}) -> source('A)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.(unlabeled)
(of type{string}
): Playlist URI.
Methods:
buffer_length
(of type() -> float
): Get the buffer’s length in seconds.buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.set_url
(of type({string}) -> unit
): Set the source’s url.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.status
(of type() -> string
): Return the current status of the source, either “stopped” (the source isn’t trying to relay the HTTP stream), “starting” (polling task is about to begin) “polling” (attempting to connect to the HTTP stream), “connected” (connected to , buffering or playing back the stream) or “stopping” (source is stopping). stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.url
(of type() -> string
): Return the source’s current url.
input.hls.native
Play an HLS stream.
Type:
(?id : string?, ?reload : float, string) -> source('a)
where 'a is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.reload
(of typefloat
, which defaults to10.
): How often (in seconds) the playlist should be reloaded.(unlabeled)
(of typestring
): Playlist URI.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
This function is experimental.
input.http
Create a http stream using ffmpeg
Type:
(?id : string?, ?clock_safe : bool, ?debug : bool,
?deduplicate_metadata : bool, ?float_args : [string * float],
?format : string?, ?int_args : [string * int], ?max_buffer : float,
?metadata_filter : (([string * string]) -> [string * string])?,
?new_track_on_metadata : bool, ?on_connect : (([string * string]) -> unit),
?on_disconnect : (() -> unit),
?on_error : ((error
.{
kind : string,
message : string,
trace : [
{
position_end :
{
character_offset : int,
filename : string,
line_number : int
},
position_start :
{
character_offset : int,
filename : string,
line_number : int
},
to_string : (?prefix : string) -> string
}]
}) -> unit),
?on_start : (() -> unit), ?on_stop : (() -> unit), ?poll_delay : float,
?self_sync : {bool?}, ?start : bool, ?string_args : [string * string],
?timeout : float, ?trim_url : bool, ?user_agent : string, {string}) ->
source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.clock_safe
(of typebool
, which defaults tofalse
): Force the use of a dedicated clockdebug
(of typebool
, which defaults tofalse
): Run in debugging mode, not catching some exceptions.deduplicate_metadata
(of typebool
, which defaults totrue
): Prevent duplicated metadata.float_args
(of type[string * float]
, which defaults to[]
)format
(of typestring?
, which defaults tonull
): Force a specific input format. Autodetected when passed a null argumentint_args
(of type[string * int]
, which defaults to[]
)max_buffer
(of typefloat
, which defaults to5.
): Maximum uration of buffered datametadata_filter
(of type(([string * string]) -> [string * string])?
, which defaults tonull
): Metadata filter function. Returned metadata are set a metadata. Default: filterid3v2_priv
metadata.new_track_on_metadata
(of typebool
, which defaults totrue
): Treat new metadata as new track.on_connect
(of type([string * string]) -> unit
, which defaults tofun (_) -> ()
): Function to execute when a source is connected. Its receives the list of ICY-specific headers, if available.on_disconnect
(of type() -> unit
, which defaults to{()}
): Function to execute when a source is disconnectedon_error
(of type(error .{ kind : string, message : string, trace : [ { position_end : {character_offset : int, filename : string, line_number : int }, position_start : {character_offset : int, filename : string, line_number : int }, to_string : (?prefix : string) -> string }] }) -> unit
, which defaults tofun (_) -> ()
): Callback executed when an error occurs.on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when input starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when input stops.poll_delay
(of typefloat
, which defaults to2.
): Polling delay when trying to connect to the stream.self_sync
(of type{bool?}
, which defaults tonull
): Should the source control its own timing? Ifnull
, the source will control its latency if it can be detected that it is connecting to anicecast
orshoutcast
server. Otherwise, seeinput.ffmpeg
for more details about this option.start
(of typebool
, which defaults totrue
): Start input as soon as it is available.string_args
(of type[string * string]
, which defaults to[]
)timeout
(of typefloat
, which defaults to10.
): Timeout for source connection.trim_url
(of typebool
, which defaults totrue
): Trim input URL.user_agent
(of typestring
, which defaults to"Liquidsoap/2.2.2 (Unix; OCaml 4.14.1)"
): User agent.(unlabeled)
(of type{string}
): URL to decode.
Methods:
buffer_length
(of type() -> float
): Get the buffer’s length in seconds.buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.set_url
(of type({string}) -> unit
): Set the source’s url.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.status
(of type() -> string
): Return the current status of the source, either “stopped” (the source isn’t trying to relay the HTTP stream), “starting” (polling task is about to begin) “polling” (attempting to connect to the HTTP stream), “connected” (connected to , buffering or playing back the stream) or “stopping” (source is stopping). stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.url
(of type() -> string
): Return the source’s current url.
input.jack
Get stream from jack.
Type:
(?id : string?, ?buffer_size : int, ?clock_safe : bool, ?fallible : bool,
?on_start : (() -> unit), ?on_stop : (() -> unit), ?server : string,
?start : bool) -> source(audio=pcm('a))
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.buffer_size
(of typeint
, which defaults to2
): Set buffer size, in frames. Must be >= 1.clock_safe
(of typebool
, which defaults totrue
): Force the use of a dedicated clockfallible
(of typebool
, which defaults tofalse
): Allow the source to fail. If set tofalse
,start
must betrue
andstop
method raises an error.on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when input starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when input stops.server
(of typestring
, which defaults to""
): Jack server to connect to.start
(of typebool
, which defaults totrue
): Start input as soon as it is available.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
input.keyboard.sdl
Play notes from the keyboard.
Type:
(?id : string?, ?velocity : float) -> source(midi=midi('a))
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.velocity
(of typefloat
, which defaults to0.8
): Velocity of notes.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
This function is experimental.
input.oss
Stream from an OSS input device.
Type:
(?id : string?, ?clock_safe : bool, ?device : string, ?fallible : bool,
?on_start : (() -> unit), ?on_stop : (() -> unit), ?start : bool) ->
source(audio=pcm('a))
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.clock_safe
(of typebool
, which defaults totrue
): Force the use of a dedicated clockdevice
(of typestring
, which defaults to"/dev/dsp"
): OSS device to use.fallible
(of typebool
, which defaults tofalse
): Allow the source to fail. If set tofalse
,start
must betrue
andstop
method raises an error.on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when input starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when input stops.start
(of typebool
, which defaults totrue
): Start input as soon as it is available.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
input.portaudio
Stream from a portaudio input device.
Type:
(?id : string?, ?buflen : int, ?clock_safe : bool, ?device_id : int?,
?fallible : bool, ?latency : float?, ?on_start : (() -> unit),
?on_stop : (() -> unit), ?start : bool) -> source(audio=pcm('a))
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.buflen
(of typeint
, which defaults to256
): Length of a buffer in samples.clock_safe
(of typebool
, which defaults totrue
): Force the use of a dedicated clockdevice_id
(of typeint?
, which defaults tonull
): Device ID. Uses default device ifnull
.fallible
(of typebool
, which defaults tofalse
): Allow the source to fail. If set tofalse
,start
must betrue
andstop
method raises an error.latency
(of typefloat?
, which defaults tonull
): Device latency. Only used when specifying device ID.on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when input starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when input stops.start
(of typebool
, which defaults totrue
): Start input as soon as it is available.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
input.pulseaudio
Stream from a pulseaudio input device.
Type:
(?id : string?, ?client : string, ?clock_safe : bool, ?clock_safe : bool,
?device : string, ?fallible : bool, ?on_start : (() -> unit),
?on_stop : (() -> unit), ?start : bool) -> source(audio=pcm('a))
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.client
(of typestring
, which defaults to"liquidsoap"
)clock_safe
(of typebool
, which defaults totrue
): Force the use of a dedicated clockclock_safe
(of typebool
, which defaults totrue
): Force the use of the dedicated Pulseaudio clock.device
(of typestring
, which defaults to""
): Device to use. Uses default if set to ““.fallible
(of typebool
, which defaults tofalse
): Allow the source to fail. If set tofalse
,start
must betrue
andstop
method raises an error.on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when input starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when input stops.start
(of typebool
, which defaults totrue
): Start input as soon as it is available.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
input.rtmp
Read an RTMP stream.
Type:
(?id : string?, ?max_buffer : float, ?listen : bool, {string}) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
)max_buffer
(of typefloat
, which defaults to5.
): Maximum data buffer in secondslisten
(of typebool
, which defaults totrue
): Act as a RTMP server and wait for incoming connection(unlabeled)
(of type{string}
): URL to read RTMP from, in the formrtmp://IP:PORT/ENDPOINT
Methods:
buffer_length
(of type() -> float
): Get the buffer’s length in seconds.buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.set_url
(of type({string}) -> unit
): Set the source’s url.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.status
(of type() -> string
): Return the current status of the source, either “stopped” (the source isn’t trying to relay the HTTP stream), “starting” (polling task is about to begin) “polling” (attempting to connect to the HTTP stream), “connected” (connected to , buffering or playing back the stream) or “stopping” (source is stopping). stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.url
(of type() -> string
): Return the source’s current url.
input.srt
Receive a SRT stream from a distant agent.
Type:
(?id : string?, ?bind_address : string, ?clock_safe : bool,
?connection_timeout : float?, ?content_type : string, ?dump : string,
?enforced_encryption : bool?, ?host : string,
?listen_callback : ((hs_version : int, peeraddr : string,
streamid : string?, srt_socket
.{
bistats : (?clear : bool?, ?instantaneous : bool?) ->
{
byteAvailRcvBuf : int,
byteAvailSndBuf : int,
byteMSS : int,
byteRcvBuf : int,
byteRcvDrop : int,
byteRcvDropTotal : int,
byteRcvUndecrypt : int,
byteRcvUndecryptTotal : int,
byteRecv : int,
byteRecvTotal : int,
byteRetrans : int,
byteRetransTotal : int,
byteSent : int,
byteSentTotal : int,
byteSndBuf : int,
byteSndDrop : int,
byteSndDropTotal : int,
mbpsBandwidth : float,
mbpsMaxBW : float,
mbpsRecvRate : float,
mbpsSendRate : float,
msRTT : float,
msRcvBuf : int,
msRcvTsbPdDelay : int,
msSndBuf : int,
msSndTsbPdDelay : int,
msTimeStamp : int,
pktCongestionWindow : int,
pktFlightSize : int,
pktFlowWindow : int,
pktRcvAvgBelatedTime : float,
pktRcvBelated : int,
pktRcvBuf : int,
pktRcvDrop : int,
pktRcvDropTotal : int,
pktRcvFilterExtra : int,
pktRcvFilterExtraTotal : int,
pktRcvFilterLoss : int,
pktRcvFilterLossTotal : int,
pktRcvFilterSupply : int,
pktRcvFilterSupplyTotal : int,
pktRcvLoss : int,
pktRcvLossTotal : int,
pktRcvRetrans : int,
pktRcvUndecrypt : int,
pktRcvUndecryptTotal : int,
pktRecv : int,
pktRecvACK : int,
pktRecvACKTotal : int,
pktRecvNAK : int,
pktRecvNAKTotal : int,
pktRecvTotal : int,
pktReorderDistance : int,
pktRetrans : int,
pktRetransTotal : int,
pktSent : int,
pktSentACK : int,
pktSentACKTotal : int,
pktSentNAK : int,
pktSentNAKTotal : int,
pktSentTotal : int,
pktSndBuf : int,
pktSndDrop : int,
pktSndDropTotal : int,
pktSndFilterExtra : int,
pktSndFilterExtraTotal : int,
pktSndLoss : int,
pktSndLossTotal : int,
usPktSndPeriod : float,
usSndDuration : int,
usSndDurationTotal : int},
bstats : (?clear : bool?) ->
{
byteAvailRcvBuf : int,
byteAvailSndBuf : int,
byteMSS : int,
byteRcvBuf : int,
byteRcvDrop : int,
byteRcvDropTotal : int,
byteRcvUndecrypt : int,
byteRcvUndecryptTotal : int,
byteRecv : int,
byteRecvTotal : int,
byteRetrans : int,
byteRetransTotal : int,
byteSent : int,
byteSentTotal : int,
byteSndBuf : int,
byteSndDrop : int,
byteSndDropTotal : int,
mbpsBandwidth : float,
mbpsMaxBW : float,
mbpsRecvRate : float,
mbpsSendRate : float,
msRTT : float,
msRcvBuf : int,
msRcvTsbPdDelay : int,
msSndBuf : int,
msSndTsbPdDelay : int,
msTimeStamp : int,
pktCongestionWindow : int,
pktFlightSize : int,
pktFlowWindow : int,
pktRcvAvgBelatedTime : float,
pktRcvBelated : int,
pktRcvBuf : int,
pktRcvDrop : int,
pktRcvDropTotal : int,
pktRcvFilterExtra : int,
pktRcvFilterExtraTotal : int,
pktRcvFilterLoss : int,
pktRcvFilterLossTotal : int,
pktRcvFilterSupply : int,
pktRcvFilterSupplyTotal : int,
pktRcvLoss : int,
pktRcvLossTotal : int,
pktRcvRetrans : int,
pktRcvUndecrypt : int,
pktRcvUndecryptTotal : int,
pktRecv : int,
pktRecvACK : int,
pktRecvACKTotal : int,
pktRecvNAK : int,
pktRecvNAKTotal : int,
pktRecvTotal : int,
pktReorderDistance : int,
pktRetrans : int,
pktRetransTotal : int,
pktSent : int,
pktSentACK : int,
pktSentACKTotal : int,
pktSentNAK : int,
pktSentNAKTotal : int,
pktSentTotal : int,
pktSndBuf : int,
pktSndDrop : int,
pktSndDropTotal : int,
pktSndFilterExtra : int,
pktSndFilterExtraTotal : int,
pktSndLoss : int,
pktSndLossTotal : int,
usPktSndPeriod : float,
usSndDuration : int,
usSndDurationTotal : int},
close : () -> unit,
pbkeylen : () -> int,
read_data : () -> int,
read_latency : () -> int,
read_timeout : () -> int,
status : () -> string,
streamid : () -> string,
write_timeout : () -> int
}) -> bool)?,
?max : float, ?messageapi : bool, ?mode : string,
?on_connect : (() -> unit), ?on_disconnect : (() -> unit),
?on_start : (() -> unit), ?on_stop : (() -> unit), ?passphrase : string?,
?payload_size : int, ?pbkeylen : int?, ?polling_delay : float, ?port : int,
?read_timeout : float?, ?start : bool, ?streamid : string?,
?write_timeout : float?) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.bind_address
(of typestring
, which defaults to"0.0.0.0"
): Address to bind on the local machine. Used only in listener modeclock_safe
(of typebool
, which defaults totrue
): Force the use of a dedicated clockconnection_timeout
(of typefloat?
, which defaults tonull
): Timeout, in seconds, after which initial connection operations are aborted if no data was received. Uses library’s default ifnulll
. Used only inclient
mode.content_type
(of typestring
, which defaults to"application/ffmpeg"
): Content-Type (mime type) used to find a decoder for the input stream.dump
(of typestring
, which defaults to""
): Dump received data to the given file for debugging. Unused is empty.enforced_encryption
(of typebool?
, which defaults tonull
): Enforces that both connection parties have the same passphrase set, or both do not set the passphrase, otherwise the connection is rejected.host
(of typestring
, which defaults to"localhost"
): Address to connect to. Used only in caller mode.listen_callback
(of type((hs_version : int, peeraddr : string, streamid : string?, srt_socket .{ bistats : (?clear : bool?, ?instantaneous : bool?) -> { byteAvailRcvBuf : int, byteAvailSndBuf : int, byteMSS : int, byteRcvBuf : int, byteRcvDrop : int, byteRcvDropTotal : int, byteRcvUndecrypt : int, byteRcvUndecryptTotal : int, byteRecv : int, byteRecvTotal : int, byteRetrans : int, byteRetransTotal : int, byteSent : int, byteSentTotal : int, byteSndBuf : int, byteSndDrop : int, byteSndDropTotal : int, mbpsBandwidth : float, mbpsMaxBW : float, mbpsRecvRate : float, mbpsSendRate : float, msRTT : float, msRcvBuf : int, msRcvTsbPdDelay : int, msSndBuf : int, msSndTsbPdDelay : int, msTimeStamp : int, pktCongestionWindow : int, pktFlightSize : int, pktFlowWindow : int, pktRcvAvgBelatedTime : float, pktRcvBelated : int, pktRcvBuf : int, pktRcvDrop : int, pktRcvDropTotal : int, pktRcvFilterExtra : int, pktRcvFilterExtraTotal : int, pktRcvFilterLoss : int, pktRcvFilterLossTotal : int, pktRcvFilterSupply : int, pktRcvFilterSupplyTotal : int, pktRcvLoss : int, pktRcvLossTotal : int, pktRcvRetrans : int, pktRcvUndecrypt : int, pktRcvUndecryptTotal : int, pktRecv : int, pktRecvACK : int, pktRecvACKTotal : int, pktRecvNAK : int, pktRecvNAKTotal : int, pktRecvTotal : int, pktReorderDistance : int, pktRetrans : int, pktRetransTotal : int, pktSent : int, pktSentACK : int, pktSentACKTotal : int, pktSentNAK : int, pktSentNAKTotal : int, pktSentTotal : int, pktSndBuf : int, pktSndDrop : int, pktSndDropTotal : int, pktSndFilterExtra : int, pktSndFilterExtraTotal : int, pktSndLoss : int, pktSndLossTotal : int, usPktSndPeriod : float, usSndDuration : int, usSndDurationTotal : int}, bstats : (?clear : bool?) -> { byteAvailRcvBuf : int, byteAvailSndBuf : int, byteMSS : int, byteRcvBuf : int, byteRcvDrop : int, byteRcvDropTotal : int, byteRcvUndecrypt : int, byteRcvUndecryptTotal : int, byteRecv : int, byteRecvTotal : int, byteRetrans : int, byteRetransTotal : int, byteSent : int, byteSentTotal : int, byteSndBuf : int, byteSndDrop : int, byteSndDropTotal : int, mbpsBandwidth : float, mbpsMaxBW : float, mbpsRecvRate : float, mbpsSendRate : float, msRTT : float, msRcvBuf : int, msRcvTsbPdDelay : int, msSndBuf : int, msSndTsbPdDelay : int, msTimeStamp : int, pktCongestionWindow : int, pktFlightSize : int, pktFlowWindow : int, pktRcvAvgBelatedTime : float, pktRcvBelated : int, pktRcvBuf : int, pktRcvDrop : int, pktRcvDropTotal : int, pktRcvFilterExtra : int, pktRcvFilterExtraTotal : int, pktRcvFilterLoss : int, pktRcvFilterLossTotal : int, pktRcvFilterSupply : int, pktRcvFilterSupplyTotal : int, pktRcvLoss : int, pktRcvLossTotal : int, pktRcvRetrans : int, pktRcvUndecrypt : int, pktRcvUndecryptTotal : int, pktRecv : int, pktRecvACK : int, pktRecvACKTotal : int, pktRecvNAK : int, pktRecvNAKTotal : int, pktRecvTotal : int, pktReorderDistance : int, pktRetrans : int, pktRetransTotal : int, pktSent : int, pktSentACK : int, pktSentACKTotal : int, pktSentNAK : int, pktSentNAKTotal : int, pktSentTotal : int, pktSndBuf : int, pktSndDrop : int, pktSndDropTotal : int, pktSndFilterExtra : int, pktSndFilterExtraTotal : int, pktSndLoss : int, pktSndLossTotal : int, usPktSndPeriod : float, usSndDuration : int, usSndDurationTotal : int}, close : () -> unit, pbkeylen : () -> int, read_data : () -> int, read_latency : () -> int, read_timeout : () -> int, status : () -> string, streamid : () -> string, write_timeout : () -> int }) -> bool)?
, which defaults tonull
): Callback used to decide whether to accept new incoming connections. Used in listener mode only.max
(of typefloat
, which defaults to10.
): Maximum duration of the buffered data.messageapi
(of typebool
, which defaults totrue
): Use message apimode
(of typestring
, which defaults to"listener"
): Mode to operate on. One of:"listener"
(waits for connection to come in) or"caller"
(initiate connection to a remote server)on_connect
(of type() -> unit
, which defaults to{()}
): Function to execute when connected.on_disconnect
(of type() -> unit
, which defaults to{()}
): Function to execute when disconnectedon_start
(of type() -> unit
, which defaults to{()}
): Callback executed when input starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when input stops.passphrase
(of typestring?
, which defaults tonull
): When set to a non-empty string, this option enables encryption and sets the passphrase for it. Seelibsrt
documentation for more details.payload_size
(of typeint
, which defaults to1316
): Payload size.pbkeylen
(of typeint?
, which defaults tonull
): Set encryption key length. Seelibsrt
documentation for more details.polling_delay
(of typefloat
, which defaults to2.
): Delay between connection attempts. Used only in caller mode.port
(of typeint
, which defaults to8000
): Port to bind on the local machine (listener mode) or to connect to (caller mode). The termport
as used in SRT is occasionally identical to the termUDP port
. However SRT offers more flexibility than UDP because it manages ports as its own resources. For example, one port may be shared between various services.read_timeout
(of typefloat?
, which defaults to1.
): Timeout, in seconds, after which read operations are aborted if no data was received, indefinite ifnull
.start
(of typebool
, which defaults totrue
): Start input as soon as it is available.streamid
(of typestring?
, which defaults tonull
): Setstreamid
. This value can be retrieved by the listener side when connecting to it. Used in caller mode only.write_timeout
(of typefloat?
, which defaults to1.
): Timeout, in seconds, after which write operations are aborted if no data was received, indefinite ifnull
.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.sockets
(of type() -> [string * srt_socket .{ bistats : (?clear : bool?, ?instantaneous : bool?) -> { byteAvailRcvBuf : int, byteAvailSndBuf : int, byteMSS : int, byteRcvBuf : int, byteRcvDrop : int, byteRcvDropTotal : int, byteRcvUndecrypt : int, byteRcvUndecryptTotal : int, byteRecv : int, byteRecvTotal : int, byteRetrans : int, byteRetransTotal : int, byteSent : int, byteSentTotal : int, byteSndBuf : int, byteSndDrop : int, byteSndDropTotal : int, mbpsBandwidth : float, mbpsMaxBW : float, mbpsRecvRate : float, mbpsSendRate : float, msRTT : float, msRcvBuf : int, msRcvTsbPdDelay : int, msSndBuf : int, msSndTsbPdDelay : int, msTimeStamp : int, pktCongestionWindow : int, pktFlightSize : int, pktFlowWindow : int, pktRcvAvgBelatedTime : float, pktRcvBelated : int, pktRcvBuf : int, pktRcvDrop : int, pktRcvDropTotal : int, pktRcvFilterExtra : int, pktRcvFilterExtraTotal : int, pktRcvFilterLoss : int, pktRcvFilterLossTotal : int, pktRcvFilterSupply : int, pktRcvFilterSupplyTotal : int, pktRcvLoss : int, pktRcvLossTotal : int, pktRcvRetrans : int, pktRcvUndecrypt : int, pktRcvUndecryptTotal : int, pktRecv : int, pktRecvACK : int, pktRecvACKTotal : int, pktRecvNAK : int, pktRecvNAKTotal : int, pktRecvTotal : int, pktReorderDistance : int, pktRetrans : int, pktRetransTotal : int, pktSent : int, pktSentACK : int, pktSentACKTotal : int, pktSentNAK : int, pktSentNAKTotal : int, pktSentTotal : int, pktSndBuf : int, pktSndDrop : int, pktSndDropTotal : int, pktSndFilterExtra : int, pktSndFilterExtraTotal : int, pktSndLoss : int, pktSndLossTotal : int, usPktSndPeriod : float, usSndDuration : int, usSndDurationTotal : int}, bstats : (?clear : bool?) -> { byteAvailRcvBuf : int, byteAvailSndBuf : int, byteMSS : int, byteRcvBuf : int, byteRcvDrop : int, byteRcvDropTotal : int, byteRcvUndecrypt : int, byteRcvUndecryptTotal : int, byteRecv : int, byteRecvTotal : int, byteRetrans : int, byteRetransTotal : int, byteSent : int, byteSentTotal : int, byteSndBuf : int, byteSndDrop : int, byteSndDropTotal : int, mbpsBandwidth : float, mbpsMaxBW : float, mbpsRecvRate : float, mbpsSendRate : float, msRTT : float, msRcvBuf : int, msRcvTsbPdDelay : int, msSndBuf : int, msSndTsbPdDelay : int, msTimeStamp : int, pktCongestionWindow : int, pktFlightSize : int, pktFlowWindow : int, pktRcvAvgBelatedTime : float, pktRcvBelated : int, pktRcvBuf : int, pktRcvDrop : int, pktRcvDropTotal : int, pktRcvFilterExtra : int, pktRcvFilterExtraTotal : int, pktRcvFilterLoss : int, pktRcvFilterLossTotal : int, pktRcvFilterSupply : int, pktRcvFilterSupplyTotal : int, pktRcvLoss : int, pktRcvLossTotal : int, pktRcvRetrans : int, pktRcvUndecrypt : int, pktRcvUndecryptTotal : int, pktRecv : int, pktRecvACK : int, pktRecvACKTotal : int, pktRecvNAK : int, pktRecvNAKTotal : int, pktRecvTotal : int, pktReorderDistance : int, pktRetrans : int, pktRetransTotal : int, pktSent : int, pktSentACK : int, pktSentACKTotal : int, pktSentNAK : int, pktSentNAKTotal : int, pktSentTotal : int, pktSndBuf : int, pktSndDrop : int, pktSndDropTotal : int, pktSndFilterExtra : int, pktSndFilterExtraTotal : int, pktSndLoss : int, pktSndLossTotal : int, usPktSndPeriod : float, usSndDuration : int, usSndDurationTotal : int}, close : () -> unit, pbkeylen : () -> int, read_data : () -> int, read_latency : () -> int, read_timeout : () -> int, status : () -> string, streamid : () -> string, write_timeout : () -> int }]
): List of(connected_address, connected_socket)
start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
input.v4l2
Stream from a video4linux2 input device, such as a webcam.
Type:
(?id : string?, ?max_buffer : float, ?device : string) ->
source(video=canvas('a))
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.max_buffer
(of typefloat
, which defaults to0.5
): Maximum data buffer in secondsdevice
(of typestring
, which defaults to"/dev/video0"
): V4L2 device to use.
native.request.dynamic
Play request dynamically created by a given function.
Type:
(?id : string?, ?available : {bool}, ?prefetch : int, ?retry_delay : {float},
?timeout : float, (() -> request?)) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.available
(of type{bool}
, which defaults totrue
): Whether some new requests are available (when set to false, it stops after current playing request).prefetch
(of typeint
, which defaults to1
): How many requests should be queued in advance.retry_delay
(of type{float}
, which defaults to0.1
): Retry after a given time (in seconds) when callback returnsnull
.timeout
(of typefloat
, which defaults to20.
): Timeout (in sec.) for a single download.(unlabeled)
(of type() -> request?
)
Methods:
add
(of type(request) -> bool
):buffered
(of type() -> [string * float]
): Length of buffered data.current
(of type() -> request?
):duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.fetch
(of type() -> bool
):id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.queue
(of type() -> [request]
):remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.set
(of type(source('A)) -> unit
): Set the source.set_queue
(of type([request]) -> unit
):skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
noise
Generate audio/video noise source.
Type:
(?id : string?, ?duration : float?) -> source('a)
where 'a is a set of internal tracks
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.duration
(of typefloat?
, which defaults tonull
): Duration in seconds (null
means infinite).
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
playlist
Read a playlist or a directory and play all files.
Type:
(?id : string?, ?check_next : ((request) -> bool)?, ?prefetch : int,
?loop : bool, ?mime_type : string?, ?mode : string, ?native : bool,
?on_fail : (() -> [string])?, ?on_reload : ((string) -> unit),
?prefix : string, ?reload : int, ?reload_mode : string, ?timeout : float,
string) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.check_next
(of type((request) -> bool)?
, which defaults tonull
): Function used to filter next tracks. A candidate track is only validated if the function returns true on it. The function is called before resolution, hence metadata will only be available for requests corresponding to local files. This is typically used to avoid repetitions, but be careful: if the function rejects all attempts, the playlist will enter into a consuming loop and stop playing anything.prefetch
(of typeint
, which defaults to1
): How many requests should be queued in advance.loop
(of typebool
, which defaults totrue
): Loop on the playlist.mime_type
(of typestring?
, which defaults tonull
): Default MIME type for the playlist.null
means automatic detection.mode
(of typestring
, which defaults to"randomize"
): Play the files in the playlist either in the order (“normal” mode), or shuffle the playlist each time it is loaded, and play it in this order for a whole round (“randomize” mode), or pick a random file in the playlist each time (“random” mode).native
(of typebool
, which defaults tofalse
): Use native implementation.on_fail
(of type(() -> [string])?
, which defaults tonull
): Function executed when too many requests failed and returning the contents of a fixed playlist.on_reload
(of type(string) -> unit
, which defaults tofun (_) -> ()
): Callback called after playlist has reloaded.prefix
(of typestring
, which defaults to""
): Add a constant prefix to all requests. Useful for passing extra information using annotate, or for resolution through a particular protocol, such as replaygain.reload
(of typeint
, which defaults to0
): Amount of time (in seconds or rounds), when applicable, before which the playlist is reloaded; 0 means never.reload_mode
(of typestring
, which defaults to"seconds"
): Unit of the reload parameter, either “never” (never reload the playlist), “rounds”, “seconds” or “watch” (reload the file whenever it is changed).timeout
(of typefloat
, which defaults to20.
): Timeout (in sec.) for a single download.(unlabeled)
(of typestring
): Playlist URI.
Methods:
add
(of type(request) -> bool
): Add a request to the queue. Requests are resolved before being added. Returnstrue
if the request was successfully added.buffered
(of type() -> [string * float]
): Length of buffered data.current
(of type() -> request?
): Get the request currently being played.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.fetch
(of type() -> bool
): Try feeding the queue with a new request. Returnstrue
if successful. This method can take long to return and should usually be run in a separate thread.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.length
(of type() -> int
): Length of the of the playlist (the number of songs it contains).log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.queue
(of type() -> [request]
): Get the requests currently in the queue.reload
(of type(?empty_queue : bool, ?uri : string?) -> unit
): Reload the playlist.remaining
(of type() -> float
): Estimation of remaining time in the current track.remaining_files
(of type() -> [string]
): Songs remaining to be played.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.set_queue
(of type([request]) -> unit
): Set the queue of requests. Requests are resolved before being added to the queue. You are responsible for destroying the requests currently in the queue.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
playlist.list
Play a list of files.
Type:
(?id : string?, ?check_next : ((request) -> bool)?, ?prefetch : int,
?loop : bool, ?mode : string, ?native : bool, ?on_loop : (() -> unit),
?on_done : (() -> unit), ?max_fail : int, ?on_fail : (() -> [string])?,
?timeout : float, [string]) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.check_next
(of type((request) -> bool)?
, which defaults tonull
): Function used to filter next tracks. A candidate track is only validated if the function returns true on it. The function is called before resolution, hence metadata will only be available for requests corresponding to local files. This is typically used to avoid repetitions, but be careful: if the function rejects all attempts, the playlist will enter into a consuming loop and stop playing anything.prefetch
(of typeint
, which defaults to1
): How many requests should be queued in advance.loop
(of typebool
, which defaults totrue
): Loop on the playlist.mode
(of typestring
, which defaults to"normal"
): Play the files in the playlist either in the order (“normal” mode), or shuffle the playlist each time it is loaded, and play it in this order for a whole round (“randomize” mode), or pick a random file in the playlist each time (“random” mode).native
(of typebool
, which defaults tofalse
): Use native implementation, when available.on_loop
(of type() -> unit
, which defaults to{()}
): Function executed when the playlist is about to loop.on_done
(of type() -> unit
, which defaults to{()}
): Function executed when the playlist is finished.max_fail
(of typeint
, which defaults to10
): When this number of requests fail to resolve, the whole playlists is considered as failed andon_fail
is called.on_fail
(of type(() -> [string])?
, which defaults tonull
): Function executed when too many requests failed and returning the contents of a fixed playlist.timeout
(of typefloat
, which defaults to20.
): Timeout (in sec.) for a single download.(unlabeled)
(of type[string]
): Playlist.
Methods:
add
(of type(request) -> bool
): Add a request to the queue. Requests are resolved before being added. Returnstrue
if the request was successfully added.buffered
(of type() -> [string * float]
): Length of buffered data.current
(of type() -> request?
): Get the request currently being played.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.fetch
(of type() -> bool
): Try feeding the queue with a new request. Returnstrue
if successful. This method can take long to return and should usually be run in a separate thread.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.queue
(of type() -> [request]
): Get the requests currently in the queue.reload
(of type(?empty_queue : bool, [string]) -> unit
): Reload the playlist with given list of songs.remaining
(of type() -> float
): Estimation of remaining time in the current track.remaining_files
(of type() -> [string]
): Songs remaining to be played.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.set_queue
(of type([request]) -> unit
): Set the queue of requests. Requests are resolved before being added to the queue. You are responsible for destroying the requests currently in the queue.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
request.dynamic
Play request dynamically created by a given function.
Type:
(?id : string?, ?available : {bool}, ?prefetch : int, ?retry_delay : {float},
?timeout : float, (() -> request?)) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.available
(of type{bool}
, which defaults totrue
): Whether some new requests are available (when set to false, it stops after current playing request).prefetch
(of typeint
, which defaults to1
): How many requests should be queued in advance.retry_delay
(of type{float}
, which defaults to0.1
): Retry after a given time (in seconds) when callback returnsnull
.timeout
(of typefloat
, which defaults to20.
): Timeout (in sec.) for a single download.(unlabeled)
(of type() -> request?
)
Methods:
add
(of type(request) -> bool
): Add a request to the queue. Requests are resolved before being added. Returnstrue
if the request was successfully added.buffered
(of type() -> [string * float]
): Length of buffered data.current
(of type() -> request?
): Get the request currently being played.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.fetch
(of type() -> bool
): Try feeding the queue with a new request. Returnstrue
if successful. This method can take long to return and should usually be run in a separate thread.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.queue
(of type() -> [request]
): Get the requests currently in the queue.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.set_queue
(of type([request]) -> unit
): Set the queue of requests. Requests are resolved before being added to the queue. You are responsible for destroying the requests currently in the queue.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
request.once
Play a request once and become unavailable.
Type:
(?id : string?, ?timeout : float, request) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.timeout
(of typefloat
, which defaults to20.
): Timeout in seconds for resolving the request.(unlabeled)
(of typerequest
): Request to play.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.request
(of typerequest
): Get the request played by this sourceresolve
(of type() -> bool
): Resolve the request (this is useful to make sure that the source will be available in advance). This function returnstrue
if we were able to successfully perform resolution. You should use this method instead ofrequest.resolve
to make sure that the proper content type is decoded from the request.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
saw
Generate a saw wave.
Type:
(?id : string?, ?amplitude : {float}, ?duration : float?, ?{float}) ->
source(audio=pcm*)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.amplitude
(of type{float}
, which defaults to1.
): Maximal value of the waveform.duration
(of typefloat?
, which defaults tonull
): Duration in seconds (null
means infinite).(unlabeled)
(of type{float}
, which defaults to440.
): Frequency of the saw.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
sine
Generate a sine wave.
Type:
(?id : string?, ?amplitude : {float}, ?duration : float?, ?{float}) ->
source(audio=pcm*)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.amplitude
(of type{float}
, which defaults to1.
): Maximal value of the waveform.duration
(of typefloat?
, which defaults tonull
): Duration in seconds (null
means infinite).(unlabeled)
(of type{float}
, which defaults to440.
): Frequency of the sine.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
single
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.
Type:
(?id : string?, ?fallible : bool, ?prefetch : int, ?timeout : float, string) ->
source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.fallible
(of typebool
, which defaults tofalse
): Enforce fallibility of the request.prefetch
(of typeint
, which defaults to1
): How many requests should be queued in advance.timeout
(of typefloat
, which defaults to20.
): Timeout (in sec.) for a single download.(unlabeled)
(of typestring
): URI where to find the file
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
source
Create a source that muxes the given tracks.
Type:
(?id : string?, 'a.{metadata? : metadata, track_marks? : track_marks}) ->
source('a) where 'a is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.(unlabeled)
(of type'a.{metadata? : metadata, track_marks? : track_marks} where 'a is a set of tracks to be muxed into a source
): Tracks to mux
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
source.fail
A source that does not produce anything. No silence, no track at all.
Type:
(?id : string?) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
source.fail.init
A source that errors during its initialization phase, used for testing and debugging.
Type:
(?id : string?) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
This function is experimental.
square
Generate a square wave.
Type:
(?id : string?, ?amplitude : {float}, ?duration : float?, ?{float}) ->
source(audio=pcm*)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.amplitude
(of type{float}
, which defaults to1.
): Maximal value of the waveform.duration
(of typefloat?
, which defaults tonull
): Duration in seconds (null
means infinite).(unlabeled)
(of type{float}
, which defaults to440.
): Frequency of the square.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.testsrc
Generate a test video.
Type:
(?id : string?, ?height : int, ?width : int) -> source('a)
where 'a is a set of internal tracks
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.height
(of typeint
, which defaults to-1
)width
(of typeint
, which defaults to-1
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
Source / Liquidsoap
buffer
Create a buffer between two different clocks.
Type:
(?id : string?, ?buffer : float, ?fallible : bool, ?max : float,
?on_start : (() -> unit), ?on_stop : (() -> unit), ?start : bool,
source('a)) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.buffer
(of typefloat
, which defaults to1.
): Amount of data to pre-buffer, in seconds.fallible
(of typebool
, which defaults totrue
): Allow the child source to fail.max
(of typefloat
, which defaults to10.
): Maximum amount of buffered data, in seconds.on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when output starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when output stops.start
(of typebool
, which defaults totrue
): Start output as soon as it is available.(unlabeled)
(of typesource('a)
)
Methods:
buffer_length
(of type() -> int
): Buffer length, in main ticksbuffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
buffer.adaptative
Create a buffer between two different clocks. The speed of the output is adapted so that no buffer underrun or overrun occurs. This wonderful behavior has a cost: the pitch of the sound might be changed a little.
Type:
(?id : string?, ?averaging : float, ?buffer : float, ?fallible : bool,
?limit : float, ?max : float, ?on_start : (() -> unit),
?on_stop : (() -> unit), ?resample : bool, ?reset : bool, ?start : bool,
source(audio=pcm('a), 'b)) -> source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.averaging
(of typefloat
, which defaults to30.
): Length of the buffer averaging, in seconds (the time constant of the smoothing to be precise). The greater this is, the less reactive to local variations we are.buffer
(of typefloat
, which defaults to1.
): Amount of data to prebuffer, in seconds.fallible
(of typebool
, which defaults tofalse
): Allow the child source to fail, in which case the output will be stopped until the source is available again.limit
(of typefloat
, which defaults to1.25
): Maximum acceleration or deceleration factor, ie how fast or slow we can be compared to realtime.max
(of typefloat
, which defaults to10.
): Maximum amount of buffered data, in seconds.on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when output starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when output stops.resample
(of typebool
, which defaults totrue
): Use proper resampling instead of simply duplicating samples.reset
(of typebool
, which defaults tofalse
): Reset speed estimation to 1 when the source becomes available again (resuming from a buffer underflow).start
(of typebool
, which defaults totrue
): Start output as soon as it is available.(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Current buffer duration, in seconds.elapsed
(of type() -> float
): Elapsed time in the current track.estimated
(of type() -> float
): Current smoothed buffer duration, in seconds.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.ratio
(of type() -> float
): Get the current scaling ratio.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
This function is experimental.
source.drop
Animate the source as fast as possible, dropping its output.
Type:
(source('a), ?ratio : float) -> unit
Arguments:
(unlabeled)
(of typesource('a)
): Source to animate.ratio
(of typefloat
, which defaults to50.
): Time ratio. A value of50
means process data at50x
real rate, when possible.
This function is experimental.
source.dump
Immediately encode the whole contents of a source into a file.
Type:
(format('a), string, source('a), ?ratio : float) -> unit
Arguments:
(unlabeled)
(of typeformat('a)
): Encoding format.(unlabeled)
(of typestring
): Name of the file.(unlabeled)
(of typesource('a)
): Source to encode.ratio
(of typefloat
, which defaults to50.
): Time ratio. A value of50
means process data at50x
real rate, when possible.
This function is experimental.
source.duration
Estimation of the duration in the current track.
Type:
(source('a)) -> float
Arguments:
(unlabeled)
(of typesource('a)
)
source.elapsed
Elapsed time in the current track.
Type:
(source('a)) -> float
Arguments:
(unlabeled)
(of typesource('a)
)
source.fallible
Indicate if a source may fail, i.e. may not be ready to stream.
Type:
(source('a)) -> bool
Arguments:
(unlabeled)
(of typesource('a)
)
source.id
Get the identifier of a source.
Type:
(source('a)) -> string
Arguments:
(unlabeled)
(of typesource('a)
)
source.init
Simultaneously initialize sources, return the sublist of sources that failed to initialize.
Type:
([source('a)]) -> [source('a)]
Arguments:
(unlabeled)
(of type[source('a)]
)
This function is experimental.
source.is_ready
Indicate if a source is ready to stream (we also say that it is available), or currently streaming.
Type:
(source('a)) -> bool
Arguments:
(unlabeled)
(of typesource('a)
)
source.on_shutdown
Register a function to be called when source is not used anymore by another source.
Type:
(source('a), (() -> unit)) -> unit
Arguments:
(unlabeled)
(of typesource('a)
)(unlabeled)
(of type() -> unit
)
source.remaining
Estimation of remaining time in the current track.
Type:
(source('a)) -> float
Arguments:
(unlabeled)
(of typesource('a)
)
source.seek
Seek forward, in seconds. Returns the amount of time effectively seeked.
Type:
(source('a), float) -> float
Arguments:
(unlabeled)
(of typesource('a)
)(unlabeled)
(of typefloat
)
source.set_name
Set the name of an operator.
Type:
(source('a), string) -> unit
Arguments:
(unlabeled)
(of typesource('a)
)(unlabeled)
(of typestring
)
source.skip
Skip to the next track.
Type:
(source('a)) -> unit
Arguments:
(unlabeled)
(of typesource('a)
)
source.time
Get a source’s time, based on its assigned clock
Type:
(source('a)) -> float
Arguments:
(unlabeled)
(of typesource('a)
)
Source / MIDI processing
midi.chord
Generate a chord.
Type:
(?id : string?, ?metadata : string, source('a)) ->
source(midi=midi(channels=1), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.metadata
(of typestring
, which defaults to"chord"
): Name of the metadata containing the chords.(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
midi.merge_all
Merge all MIDI tracks in one.
Type:
(?id : string?, ?track_out : int, source(midi=midi('a), 'b)) ->
source(midi=midi('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.track_out
(of typeint
, which defaults to0
): Destination track.(unlabeled)
(of typesource(midi=midi('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
midi.remove
Remove MIDI tracks.
Type:
(?id : string?, [int], source(midi=midi('a), 'b)) -> source(midi=midi('a),
'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.(unlabeled)
(of type[int]
): Tracks to remove.(unlabeled)
(of typesource(midi=midi('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
Source / Output
ffmpeg.filter.audio_video.output
Return a source with audio and video from a filter’s output.
Type:
(?id : string?, ffmpeg.filter.graph, 'b
.{tracks : () -> 'a.{audio : ffmpeg.filter.audio}}, 'd
.{tracks : () -> 'c.{video : ffmpeg.filter.video}}) ->
source(audio=ffmpeg.audio.raw('e), video=ffmpeg.video.raw('f))
Arguments:
id
(of typestring?
, which defaults tonull
)(unlabeled)
(of typeffmpeg.filter.graph
): Force the value of the source ID.(unlabeled)
(of type'b.{tracks : () -> 'a.{audio : ffmpeg.filter.audio}}
)(unlabeled)
(of type'd.{tracks : () -> 'c.{video : ffmpeg.filter.video}}
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
output
Output a stream using the default operator. The input source does not need to be infallible, blank will just be played during failures.
Type:
(?id : string?, ?fallible : bool, ?on_start : (() -> unit),
?on_stop : (() -> unit), ?start : bool, source(audio=pcm('A))) -> unit
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.fallible
(of typebool
, which defaults totrue
): Allow the child source to fail, in which case the output will be (temporarily) stopped.on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when outputting starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when outputting stops.start
(of typebool
, which defaults totrue
): Automatically start outputting whenever possible. Iftrue
, an infallible (normal) output will start outputting as soon as it is created, and a fallible output will (re)start as soon as its source becomes available for streaming.(unlabeled)
(of typesource(audio=pcm('A))
): Source to play.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
output.alsa
Output the source’s stream to an ALSA output device.
Type:
(?id : string?, ?bufferize : bool, ?clock_safe : bool, ?device : string,
?fallible : bool, ?on_start : (() -> unit), ?on_stop : (() -> unit),
?start : bool, source(audio=pcm('a), 'b)) -> unit
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.bufferize
(of typebool
, which defaults totrue
): Bufferize outputclock_safe
(of typebool
, which defaults totrue
): Force the use of the dedicated ALSA clockdevice
(of typestring
, which defaults to"default"
): Alsa device to usefallible
(of typebool
, which defaults tofalse
): Allow the child source to fail, in which case the output will be stopped until the source is available again.on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when output starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when output stops.start
(of typebool
, which defaults totrue
): Start output as soon as it is available.(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
output.ao
Output stream to local sound card using libao.
Type:
(?id : string?, ?buffer_size : int, ?channels_matrix : string,
?clock_safe : bool, ?driver : string, ?fallible : bool,
?on_start : (() -> unit), ?on_stop : (() -> unit),
?options : [string * string], ?start : bool, source(audio=pcm('a), 'b)) ->
unit
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.buffer_size
(of typeint
, which defaults to2
): Set buffer size, in frames.channels_matrix
(of typestring
, which defaults to""
): Output channels matrix, “” for AO’s default.clock_safe
(of typebool
, which defaults totrue
): Use the dedicated AO clock.driver
(of typestring
, which defaults to""
): Driver to be used, “” for AO’s default.fallible
(of typebool
, which defaults tofalse
): Allow the child source to fail, in which case the output will be stopped until the source is available again.on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when output starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when output stops.options
(of type[string * string]
, which defaults to[]
): List of parameters, depends on the driver.start
(of typebool
, which defaults totrue
): Start output as soon as it is available.(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
output.audio_video
Output a stream with audio and video using the default operator. The input source does not need to be infallible, blank will just be played during failures.
Type:
(?id : string?, ?fallible : bool, ?on_start : (() -> unit),
?on_stop : (() -> unit), ?start : bool, source(audio=pcm('A),
video=canvas('a))) -> unit
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.fallible
(of typebool
, which defaults totrue
): Allow the child source to fail, in which case the output will be (temporarily) stopped.on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when outputting starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when outputting stops.start
(of typebool
, which defaults totrue
): Automatically start outputting whenever possible. Iftrue
, an infallible (normal) output will start outputting as soon as it is created, and a fallible output will (re)start as soon as its source becomes available for streaming.(unlabeled)
(of typesource(audio=pcm('A), video=canvas('a))
): Source to play.
output.dummy
Dummy output: computes the stream, without actually using it.
Type:
(?id : string?, ?fallible : bool, ?on_start : (() -> unit),
?on_stop : (() -> unit), ?start : bool, source('a)) -> unit
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.fallible
(of typebool
, which defaults tofalse
): Allow the child source to fail, in which case the output will be stopped until the source is available again.on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when output starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when output stops.start
(of typebool
, which defaults totrue
): Start output as soon as it is available.(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
output.external
Send the stream to a process’ standard input.
Type:
(?id : string?, ?fallible : bool, ?flush : bool, ?on_reopen : (() -> unit),
?on_start : (() -> unit), ?on_stop : (() -> unit), ?reopen_delay : {float},
?reopen_on_error : ((error
.{
kind : string,
message : string,
trace : [
{
position_end :
{
character_offset : int,
filename : string,
line_number : int
},
position_start :
{
character_offset : int,
filename : string,
line_number : int
},
to_string : (?prefix : string) -> string
}]
}?) -> float?),
?reopen_on_metadata : (([string * string]) -> bool),
?reopen_when : (() -> bool), ?self_sync : bool, ?start : bool, format('a),
{string}, source('a)) -> unit
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.fallible
(of typebool
, which defaults tofalse
): Allow the child source to fail, in which case the output will be stopped until the source is available again.flush
(of typebool
, which defaults tofalse
): Perform a flush after each write.on_reopen
(of type() -> unit
, which defaults to{()}
): Callback executed when the output is reopened.on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when output starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when output stops.reopen_delay
(of type{float}
, which defaults to120.
): Prevent re-opening within that delay, in seconds. Only applies toreopen_when
.reopen_on_error
(of type(error .{ kind : string, message : string, trace : [ { position_end : {character_offset : int, filename : string, line_number : int }, position_start : {character_offset : int, filename : string, line_number : int }, to_string : (?prefix : string) -> string }] }?) -> float?
, which defaults to<fun>
): Callback called when there is an error. Error is raised when returningnull
. Otherwise, the file is reopened after the returned value, in seconds.reopen_on_metadata
(of type([string * string]) -> bool
, which defaults tofun (_) -> false
): Callback called on metadata. If returned value istrue
, the file is reopened.reopen_when
(of type() -> bool
, which defaults to{false}
): Callback called on each frame. If returned value istrue
, the file is reopened.self_sync
(of typebool
, which defaults tofalse
): Set totrue
if the process is expected to control the output’s latency. Typical example:ffmpeg
with the-re
command-line option.start
(of typebool
, which defaults totrue
): Start output as soon as it is available.(unlabeled)
(of typeformat('a)
): Process to pipe data to.(unlabeled)
(of type{string}
): Encoding format.(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.reopen
(of type() -> unit
): Reopen the output pipe. The actual reopening happens the next time the output has some data to output.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
output.file
Output the source stream to a file.
Type:
(?id : string?, ?append : bool, ?dir_perm : int, ?fallible : bool,
?flush : bool, ?on_close : ((string) -> unit), ?on_reopen : (() -> unit),
?on_start : (() -> unit), ?on_stop : (() -> unit), ?perm : int,
?reopen_delay : {float},
?reopen_on_error : ((error
.{
kind : string,
message : string,
trace : [
{
position_end :
{
character_offset : int,
filename : string,
line_number : int
},
position_start :
{
character_offset : int,
filename : string,
line_number : int
},
to_string : (?prefix : string) -> string
}]
}?) -> float?),
?reopen_on_metadata : (([string * string]) -> bool),
?reopen_when : (() -> bool), ?start : bool, format('a), {string},
source('a)) -> unit
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.append
(of typebool
, which defaults tofalse
): Do not truncate but append in the file if it exists.dir_perm
(of typeint
, which defaults to511
): Permission of the directories if some have to be created, up to umask. Although you can enter values in octal notation (0oXXX) they will be displayed in decimal (for instance, 0o777 = 7×8^2 + 7×8 + 7 = 511).fallible
(of typebool
, which defaults tofalse
): Allow the child source to fail, in which case the output will be stopped until the source is available again.flush
(of typebool
, which defaults tofalse
): Perform a flush after each write.on_close
(of type(string) -> unit
, which defaults tofun (_) -> ()
): This function will be called for each file, after that it is finished and closed. The filename will be passed as argument.on_reopen
(of type() -> unit
, which defaults to{()}
): Callback executed when the output is reopened.on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when output starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when output stops.perm
(of typeint
, which defaults to438
): Permission of the file if it has to be created, up to umask. You can and should write this number in octal notation: 0oXXX. The default value is however displayed in decimal (0o666 = 6×8^2 + 6×8 + 6 = 438).reopen_delay
(of type{float}
, which defaults to120.
): Prevent re-opening within that delay, in seconds. Only applies toreopen_when
.reopen_on_error
(of type(error .{ kind : string, message : string, trace : [ { position_end : {character_offset : int, filename : string, line_number : int }, position_start : {character_offset : int, filename : string, line_number : int }, to_string : (?prefix : string) -> string }] }?) -> float?
, which defaults to<fun>
): Callback called when there is an error. Error is raised when returningnull
. Otherwise, the file is reopened after the returned value, in seconds.reopen_on_metadata
(of type([string * string]) -> bool
, which defaults tofun (_) -> false
): Callback called on metadata. If returned value istrue
, the file is reopened.reopen_when
(of type() -> bool
, which defaults to{false}
): Callback called on each frame. If returned value istrue
, the file is reopened.start
(of typebool
, which defaults totrue
): Start output as soon as it is available.(unlabeled)
(of typeformat('a)
): Encoding format.(unlabeled)
(of type{string}
): Filename where to output the stream.(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.reopen
(of type() -> unit
): Reopen the output pipe. The actual reopening happens the next time the output has some data to output.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
output.file.hls
Output the source stream to an HTTP live stream served from a local directory.
Type:
(?id : string?, ?dir_perm : int, ?extra_tags : [string], ?fallible : bool,
?on_file_change : ((state : string, string) -> unit),
?on_start : (() -> unit), ?on_stop : (() -> unit), ?perm : int,
?persist_at : string?, ?playlist : string, ?prefix : string,
?segment_duration : float,
?segment_name : ((position : int, extname : string, string) -> string),
?segments : int, ?segments_overhead : int, ?start : bool,
?strict_persist : bool, ?temp_dir : string?, string,
[string * format('a)
.{
bandwidth? : int,
codecs? : string,
extname? : string,
extra_tags? : [string],
id3? : bool,
id3_version? : int,
replay_id3? : bool,
video_size? : int * int
}],
source('a)) -> unit
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.dir_perm
(of typeint
, which defaults to511
): Permission of the directories if some have to be created, up to umask. Although you can enter values in octal notation (0oXXX) they will be displayed in decimal (for instance, 0o777 = 7×8^2 + 7×8 + 7 = 511).extra_tags
(of type[string]
, which defaults to[]
): Extra tags to insert into the main playlist.fallible
(of typebool
, which defaults tofalse
): Allow the child source to fail, in which case the output will be stopped until the source is available again.on_file_change
(of type(state : string, string) -> unit
, which defaults tofun (~state=_,_) -> ()
): Callback executed when a file changes.state
is one of:"created"
,"updated"
or"deleted"
, second argument is file path. Typical use: sync file with a CDNon_start
(of type() -> unit
, which defaults to{()}
): Callback executed when output starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when output stops.perm
(of typeint
, which defaults to438
): Permission of the created files, up to umask. You can and should write this number in octal notation: 0oXXX. The default value is however displayed in decimal (0o666 = 6×8^2 + 4×8 + 4 = 412).persist_at
(of typestring?
, which defaults tonull
): Location of the configuration file used to restart the output. Relative paths are assumed to be with regard to the directory for generated file.playlist
(of typestring
, which defaults to"stream.m3u8"
): Playlist name (m3u8 extension is recommended).prefix
(of typestring
, which defaults to""
): Prefix for each files in playlists.segment_duration
(of typefloat
, which defaults to10.
): Segment duration (in seconds).segment_name
(of type(position : int, extname : string, string) -> string
, which defaults to<fun>
): Segment name. Default:fun (~position,~extname,stream_name) -> "#{stream_name}_#{position}.#{extname}"
segments
(of typeint
, which defaults to10
): Number of segments per playlist.segments_overhead
(of typeint
, which defaults to5
): Number of segments to keep after they have been featured in the live playlist.start
(of typebool
, which defaults totrue
): Start output as soon as it is available.strict_persist
(of typebool
, which defaults tofalse
): Fail if an invalid saved state exists.temp_dir
(of typestring?
, which defaults tonull
): Temporary directory used for writing files. This should be in the same partition or device as the final directory to guarantee atomic file operations. Use an system-specific value ifnull
.(unlabeled)
(of typestring
): Directory for generated files.(unlabeled)
(of type[string * format('a) .{ bandwidth? : int, codecs? : string, extname? : string, extra_tags? : [string], id3? : bool, id3_version? : int, replay_id3? : bool, video_size? : int * int }]
): List of specifications for each stream: (name, format).(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.streams
(of type() -> [ { bandwidth : int, codecs : string, discontinuity_count : int, encoder : format('A), extname : string, extra_tags : [string], id3_enabled : bool, insert_tag : (string) -> unit, name : string, replay_id3 : bool, video_size : {height : int, width : int }? }]
): Output streamstime
(of type() -> float
): Get a source’s time, based on its assigned clock.
output.harbor
Encode and output the stream using the harbor server.
Type:
(?id : string?, ?auth : ((address : string, string, string) -> bool)?,
?buffer : int, ?burst : int, ?chunk : int, ?dumpfile : string?,
?encoding : string, ?fallible : bool, ?format : string,
?headers : [string * string], ?metaint : int, mount : string,
?on_connect : ((headers : [string * string], uri : string,
protocol : string, string) -> unit),
?on_disconnect : ((string) -> unit), ?on_start : (() -> unit),
?on_stop : (() -> unit), ?password : string?, ?port : int, ?start : bool,
?timeout : float, ?transport : http_transport, ?url : string?,
?user : string?, format('a), source('a)) -> unit
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.auth
(of type((address : string, string, string) -> bool)?
, which defaults tonull
): Authentication function.f(~address,login,password)
returnstrue
if the user should be granted access for this login. When defined,user
andpassword
arguments are not taken in account.buffer
(of typeint
, which defaults to327675
): Maximum buffer per-client.burst
(of typeint
, which defaults to65534
): Initial burst of data sent to the client.chunk
(of typeint
, which defaults to4096
): Send data to clients using chunks of at least this length.dumpfile
(of typestring?
, which defaults tonull
): Dump stream to file, for debugging purpose. Disabled if null.encoding
(of typestring
, which defaults to""
): Encoding used to send metadata. If empty, defaults to “UTF-8”fallible
(of typebool
, which defaults tofalse
): Allow the child source to fail, in which case the output will be stopped until the source is available again.format
(of typestring
, which defaults to""
): Format, e.g. “audio/ogg”. When empty, the encoder is used to guess.headers
(of type[string * string]
, which defaults to[]
): Additional headers.metaint
(of typeint
, which defaults to8192
): Interval used to send ICY metadatamount
(of typestring
)on_connect
(of type(headers : [string * string], uri : string, protocol : string, string) -> unit
, which defaults tofun (~headers=_,~uri=_,~protocol=_,_) -> ()
): Callback executed when connection is established (takes headers, connection uri, protocol and client’s IP as arguments).on_disconnect
(of type(string) -> unit
, which defaults tofun (_) -> ()
): Callback executed when connection stops (takes client’s IP as argument).on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when output starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when output stops.password
(of typestring?
, which defaults tonull
): Password for client connection. Auser
must also be set. We check for this password is checked unless anauth
function is defined, which is used in this case.port
(of typeint
, which defaults to8000
)start
(of typebool
, which defaults totrue
): Start output as soon as it is available.timeout
(of typefloat
, which defaults to30.
): Timeout for network operations (in seconds).transport
(of typehttp_transport
, which defaults to<unix_transport>
): Http transport. Usehttp.transport.ssl
orhttp.transport.secure_transport
, when available, to enable HTTPS outputurl
(of typestring?
, which defaults tonull
)user
(of typestring?
, which defaults tonull
): User for client connection. You also need to setup apassword
.(unlabeled)
(of typeformat('a)
): Encoding format.(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
output.harbor.hls
Output the source stream to an HTTP live stream served from the harbor HTTP server.
Type:
(?id : string?, ?dir_perm : int, ?extra_tags : [string], ?fallible : bool,
?on_file_change : ((state : string, string) -> unit),
?on_start : (() -> unit), ?on_stop : (() -> unit), ?perm : int,
?persist_at : string?, ?playlist : string, ?prefix : string,
?segment_duration : float, ?segments : int, ?segments_overhead : int,
?start : bool, ?strict_persist : bool, ?temp_dir : string?,
?segment_name : ((position : int, extname : string, string) -> string),
?headers : [string * string], ?port : int, ?path : string,
?tmpdir : string?, ?transport : http_transport
.{default_port : int, name : string, protocol : string},
[string * format('a)], source('a)) -> unit
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.dir_perm
(of typeint
, which defaults to511
): Permission of the directories if some have to be created, up to umask. Although you can enter values in octal notation (0oXXX) they will be displayed in decimal (for instance, 0o777 = 7×8^2 + 7×8 + 7 = 511).extra_tags
(of type[string]
, which defaults to[]
): Extra tags to insert into the main playlist.fallible
(of typebool
, which defaults tofalse
): Allow the child source to fail, in which case the output will be stopped until the source is available again.on_file_change
(of type(state : string, string) -> unit
, which defaults tofun (~state=_,_) -> ()
): Callback executed when a file changes.state
is one of:"created"
,"updated"
or"deleted"
, second argument is file path. Typical use: sync file with a CDNon_start
(of type() -> unit
, which defaults to{()}
): Callback executed when output starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when output stops.perm
(of typeint
, which defaults to438
): Permission of the created files, up to umask. You can and should write this number in octal notation: 0oXXX. The default value is however displayed in decimal (0o666 = 6×8^2 + 4×8 + 4 = 412).persist_at
(of typestring?
, which defaults tonull
): Location of the configuration file used to restart the output. Relative paths are assumed to be with regard to the directory for generated file.playlist
(of typestring
, which defaults to"stream.m3u8"
): Playlist name (m3u8 extension is recommended).prefix
(of typestring
, which defaults to""
): Prefix for each files in playlists.segment_duration
(of typefloat
, which defaults to10.
): Segment duration (in seconds).segments
(of typeint
, which defaults to10
): Number of segments per playlist.segments_overhead
(of typeint
, which defaults to5
): Number of segments to keep after they have been featured in the live playlist.start
(of typebool
, which defaults totrue
): Start output as soon as it is available.strict_persist
(of typebool
, which defaults tofalse
): Fail if an invalid saved state exists.temp_dir
(of typestring?
, which defaults tonull
): Temporary directory used for writing files. This should be in the same partition or device as the final directory to guarantee atomic file operations. Use an system-specific value ifnull
.segment_name
(of type(position : int, extname : string, string) -> string
, which defaults to<fun>
): Segment name. Default:fun (~position,~extname,stream_name) -> "#{stream_name}_#{position}.#{extname}"
headers
(of type[string * string]
, which defaults to[("Access-Control-Allow-Origin", "*")]
): Default response headers.port
(of typeint
, which defaults to8000
): Port for incoming harbor (http) connections.path
(of typestring
, which defaults to"/"
): Base path for hls URIs.tmpdir
(of typestring?
, which defaults tonull
): Directory for generated files.transport
(of typehttp_transport.{default_port : int, name : string, protocol : string}
, which defaults to<unix_transport>.{default_port=80, protocol="http", name="unix"}
): Http transport. Usehttp.transport.ssl
orhttp.transport.secure_transport
, when available, to enable HTTPS output(unlabeled)
(of type[string * format('a)]
): List of specifications for each stream: (name, format).(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.streams
(of type() -> [ { bandwidth : int, codecs : string, discontinuity_count : int, encoder : format('A), extname : string, extra_tags : [string], id3_enabled : bool, insert_tag : (string) -> unit, name : string, replay_id3 : bool, video_size : {height : int, width : int }? }]
): Output streamstime
(of type() -> float
): Get a source’s time, based on its assigned clock.
output.icecast
Encode and output the stream to an icecast server.
Type:
(?id : string?, ?chunked : bool, ?connection_timeout : float,
?description : string?, ?dumpfile : string?, ?encoding : string?,
?fallible : bool, ?format : string, ?genre : string?,
?headers : [string * string], ?host : string, ?icy_metadata : [string],
?icy_song : (([string * string]) -> string?), ?method : string,
mount : string, ?name : string?, ?on_connect : (() -> unit),
?on_disconnect : (() -> unit), ?on_error : ((string) -> float),
?on_start : (() -> unit), ?on_stop : (() -> unit), ?password : string,
?port : int, ?public : bool, ?send_icy_metadata : bool?, ?start : bool,
?timeout : float, ?transport : http_transport, ?url : string?,
?user : string?, format('a), source('a)) -> unit
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.chunked
(of typebool
, which defaults tofalse
): Used chunked transfer with the ‘http(s)’ protocol.connection_timeout
(of typefloat
, which defaults to5.
): Timeout for establishing network connections (disabled is negative).description
(of typestring?
, which defaults tonull
)dumpfile
(of typestring?
, which defaults tonull
): Dump stream to file, for debugging purpose. Disabled if null.encoding
(of typestring?
, which defaults tonull
): Encoding used to send metadata and stream info (name, genre and description). If null, defaults to “UTF-8”.fallible
(of typebool
, which defaults tofalse
): Allow the child source to fail, in which case the output will be stopped until the source is available again.format
(of typestring
, which defaults to""
): Format, e.g. “audio/ogg”. When empty, the encoder is used to guess.genre
(of typestring?
, which defaults tonull
)headers
(of type[string * string]
, which defaults to[("User-Agent", "Liquidsoap/2.2.2 (Unix; OCaml 4.14.1)")]
): Additional headers.host
(of typestring
, which defaults to"localhost"
)icy_metadata
(of type[string]
, which defaults to["song", "title", "artist", "genre", "date", "album", "tracknum", "comment", "dj", "next"]
): List of metadata to send with ICY metadata updateicy_song
(of type([string * string]) -> string?
, which defaults to<fun>
): Function used to generate the default icy “song” metadata. Metadata is not added when returningnull
. Default:$(artist) - $(title)
if both are defined, otherwiseartist
ortitle
if either is defined ornull
.method
(of typestring
, which defaults to"source"
): Method to use with the ‘http(s)’ protocol. One of: ‘source’, ‘put’ or ‘post’.mount
(of typestring
): Source mount point.name
(of typestring?
, which defaults tonull
)on_connect
(of type() -> unit
, which defaults to{()}
): Callback executed when connection is established.on_disconnect
(of type() -> unit
, which defaults to{()}
): Callback executed when connection stops.on_error
(of type(string) -> float
, which defaults tofun (_) -> 3.
): Callback executed when an error happens. The callback receives a string representation of the error that occurred and returns a float. If returned value is positive, connection will be tried again after this amount of time (in seconds).on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when output starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when output stops.password
(of typestring
, which defaults to"hackme"
)port
(of typeint
, which defaults to8000
)public
(of typebool
, which defaults totrue
)send_icy_metadata
(of typebool?
, which defaults tonull
): Send new metadata using the ICY protocol. Guessed whennull
start
(of typebool
, which defaults totrue
): Start output as soon as it is available.timeout
(of typefloat
, which defaults to30.
): Timeout for network read and write.transport
(of typehttp_transport
, which defaults to<unix_transport>
): Http transport. Usehttp.transport.ssl
orhttp.transport.secure_transport
, when available, to enable HTTPS outputurl
(of typestring?
, which defaults tonull
)user
(of typestring?
, which defaults tonull
): User for shout source connection. Defaults to “source” for icecast connections. Useful only in special cases, like with per-mountpoint users.(unlabeled)
(of typeformat('a)
): Encoding format.(unlabeled)
(of typesource('a)
): The source to output
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
output.jack
Output stream to jack.
Type:
(?id : string?, ?buffer_size : int, ?clock_safe : bool, ?fallible : bool,
?on_start : (() -> unit), ?on_stop : (() -> unit), ?server : string,
?start : bool, source(audio=pcm('a), 'b)) -> unit
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.buffer_size
(of typeint
, which defaults to2
): Set buffer size, in frames.clock_safe
(of typebool
, which defaults totrue
): Force the use of the dedicated bjack clock.fallible
(of typebool
, which defaults tofalse
): Allow the child source to fail, in which case the output will be stopped until the source is available again.on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when output starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when output stops.server
(of typestring
, which defaults to""
): Jack server to connect to.start
(of typebool
, which defaults totrue
): Start output as soon as it is available.(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
output.oss
Output the source’s stream to an OSS output device.
Type:
(?id : string?, ?clock_safe : bool, ?device : string, ?fallible : bool,
?on_start : (() -> unit), ?on_stop : (() -> unit), ?start : bool,
source(audio=pcm('a), 'b)) -> unit
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.clock_safe
(of typebool
, which defaults totrue
): Force the use of the dedicated OSS clock.device
(of typestring
, which defaults to"/dev/dsp"
): OSS device to use.fallible
(of typebool
, which defaults tofalse
): Allow the child source to fail, in which case the output will be stopped until the source is available again.on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when output starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when output stops.start
(of typebool
, which defaults totrue
): Start output as soon as it is available.(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
output.portaudio
Output the source’s stream to a portaudio output device.
Type:
(?id : string?, ?buflen : int, ?clock_safe : bool, ?device_id : int?,
?fallible : bool, ?latency : float?, ?on_start : (() -> unit),
?on_stop : (() -> unit), ?start : bool, source(audio=pcm('a), 'b)) -> unit
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.buflen
(of typeint
, which defaults to256
): Length of a buffer in samples.clock_safe
(of typebool
, which defaults totrue
): Force the use of the dedicated Portaudio clock.device_id
(of typeint?
, which defaults tonull
): Device ID. Uses default device ifnull
.fallible
(of typebool
, which defaults tofalse
): Allow the child source to fail, in which case the output will be stopped until the source is available again.latency
(of typefloat?
, which defaults tonull
): Device latency. Only used when specifying device ID.on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when output starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when output stops.start
(of typebool
, which defaults totrue
): Start output as soon as it is available.(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
output.pulseaudio
Output the source’s stream to a pulseaudio output device.
Type:
(?id : string?, ?client : string, ?clock_safe : bool, ?device : string,
?fallible : bool, ?on_start : (() -> unit), ?on_stop : (() -> unit),
?start : bool, source(audio=pcm('a), 'b)) -> unit
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.client
(of typestring
, which defaults to"liquidsoap"
)clock_safe
(of typebool
, which defaults totrue
): Force the use of the dedicated Pulseaudio clock.device
(of typestring
, which defaults to""
): Device to use. Uses default if set to ““.fallible
(of typebool
, which defaults tofalse
): Allow the child source to fail, in which case the output will be stopped until the source is available again.on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when output starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when output stops.start
(of typebool
, which defaults totrue
): Start output as soon as it is available.(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
output.sdl
Display a video using SDL.
Type:
(?id : string?, ?fallible : bool, ?on_start : (() -> unit),
?on_stop : (() -> unit), ?start : bool, source(video=canvas('a), 'b)) ->
unit
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.fallible
(of typebool
, which defaults tofalse
): Allow the child source to fail, in which case the output will be stopped until the source is available again.on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when output starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when output stops.start
(of typebool
, which defaults totrue
): Start output as soon as it is available.(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
output.sdl.has_video
Check whether video output is available with SDL.
Type:
() -> bool
output.shoutcast
Encode and output the stream to a shoutcast server.
Type:
(?id : string?, ?chunked : bool, ?connection_timeout : float,
?dumpfile : string?, ?encoding : string?, ?fallible : bool,
?format : string, ?genre : string?, ?headers : [string * string],
?host : string, ?icy_id : int, ?icy_metadata : [string],
?icy_song : (([string * string]) -> string?), ?name : string?,
?on_connect : (() -> unit), ?on_disconnect : (() -> unit),
?on_error : ((string) -> float), ?on_start : (() -> unit),
?on_stop : (() -> unit), ?password : string, ?port : int, ?public : bool,
?send_icy_metadata : bool?, ?start : bool, ?timeout : float,
?transport : http_transport, ?url : string?, ?user : string?,
?icy_reset : bool, ?dj : (() -> string), ?aim : string, ?icq : string,
?irc : string, format('a), source('a)) -> unit
where 'a is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.chunked
(of typebool
, which defaults tofalse
): Used chunked transfer with the ‘http(s)’ protocol.connection_timeout
(of typefloat
, which defaults to5.
): Timeout for establishing network connections (disabled is negative).dumpfile
(of typestring?
, which defaults tonull
): Dump stream to file, for debugging purpose. Disabled if null.encoding
(of typestring?
, which defaults tonull
): Encoding used to send metadata and stream info (name, genre and description). If null, defaults to “UTF-8”.fallible
(of typebool
, which defaults tofalse
): Allow the child source to fail, in which case the output will be stopped until the source is available again.format
(of typestring
, which defaults to""
): Format, e.g. “audio/ogg”. When empty, the encoder is used to guess.genre
(of typestring?
, which defaults tonull
)headers
(of type[string * string]
, which defaults to[("User-Agent", "Liquidsoap/2.2.2 (Unix; OCaml 4.14.1)")]
): Additional headers.host
(of typestring
, which defaults to"localhost"
)icy_id
(of typeint
, which defaults to1
): Shoutcast source ID.icy_metadata
(of type[string]
, which defaults to["song", "title", "artist", "genre", "date", "album", "tracknum", "comment", "dj", "next"]
): List of metadata to send with ICY metadata updateicy_song
(of type([string * string]) -> string?
, which defaults to<fun>
): Function used to generate the default icy “song” metadata. Metadata is not added when returningnull
. Default:$(artist) - $(title)
if both are defined, otherwiseartist
ortitle
if either is defined ornull
.name
(of typestring?
, which defaults tonull
)on_connect
(of type() -> unit
, which defaults to{()}
): Callback executed when connection is established.on_disconnect
(of type() -> unit
, which defaults to{()}
): Callback executed when connection stops.on_error
(of type(string) -> float
, which defaults tofun (_) -> 3.
): Callback executed when an error happens. The callback receives a string representation of the error that occurred and returns a float. If returned value is positive, connection will be tried again after this amount of time (in seconds).on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when output starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when output stops.password
(of typestring
, which defaults to"hackme"
)port
(of typeint
, which defaults to8000
)public
(of typebool
, which defaults totrue
)send_icy_metadata
(of typebool?
, which defaults tonull
): Send new metadata using the ICY protocol. Guessed whennull
start
(of typebool
, which defaults totrue
): Start output as soon as it is available.timeout
(of typefloat
, which defaults to30.
): Timeout for network read and write.transport
(of typehttp_transport
, which defaults to<unix_transport>
): Http transport. Usehttp.transport.ssl
orhttp.transport.secure_transport
, when available, to enable HTTPS outputurl
(of typestring?
, which defaults tonull
)user
(of typestring?
, which defaults tonull
): User for shout source connection. Defaults to “source” for icecast connections. Useful only in special cases, like with per-mountpoint users.icy_reset
(of typebool
, which defaults totrue
): Reset shoutcast source buffer upon connecting (necessary for NSV).dj
(of type() -> string
, which defaults to{""}
): Callback to set dj name.aim
(of typestring
, which defaults to""
)icq
(of typestring
, which defaults to""
)irc
(of typestring
, which defaults to""
)(unlabeled)
(of typeformat('a) where 'a is a set of tracks to be muxed into a source
): Encoding format. Should be mp3 or AAC(+).(unlabeled)
(of typesource('a) where 'a is a set of tracks to be muxed into a source
): The source to output
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
output.srt
Send a SRT stream to a distant agent.
Type:
(?id : string?, ?bind_address : string, ?connection_timeout : float?,
?enforced_encryption : bool?, ?fallible : bool, ?host : string,
?listen_callback : ((hs_version : int, peeraddr : string,
streamid : string?, srt_socket
.{
bistats : (?clear : bool?, ?instantaneous : bool?) ->
{
byteAvailRcvBuf : int,
byteAvailSndBuf : int,
byteMSS : int,
byteRcvBuf : int,
byteRcvDrop : int,
byteRcvDropTotal : int,
byteRcvUndecrypt : int,
byteRcvUndecryptTotal : int,
byteRecv : int,
byteRecvTotal : int,
byteRetrans : int,
byteRetransTotal : int,
byteSent : int,
byteSentTotal : int,
byteSndBuf : int,
byteSndDrop : int,
byteSndDropTotal : int,
mbpsBandwidth : float,
mbpsMaxBW : float,
mbpsRecvRate : float,
mbpsSendRate : float,
msRTT : float,
msRcvBuf : int,
msRcvTsbPdDelay : int,
msSndBuf : int,
msSndTsbPdDelay : int,
msTimeStamp : int,
pktCongestionWindow : int,
pktFlightSize : int,
pktFlowWindow : int,
pktRcvAvgBelatedTime : float,
pktRcvBelated : int,
pktRcvBuf : int,
pktRcvDrop : int,
pktRcvDropTotal : int,
pktRcvFilterExtra : int,
pktRcvFilterExtraTotal : int,
pktRcvFilterLoss : int,
pktRcvFilterLossTotal : int,
pktRcvFilterSupply : int,
pktRcvFilterSupplyTotal : int,
pktRcvLoss : int,
pktRcvLossTotal : int,
pktRcvRetrans : int,
pktRcvUndecrypt : int,
pktRcvUndecryptTotal : int,
pktRecv : int,
pktRecvACK : int,
pktRecvACKTotal : int,
pktRecvNAK : int,
pktRecvNAKTotal : int,
pktRecvTotal : int,
pktReorderDistance : int,
pktRetrans : int,
pktRetransTotal : int,
pktSent : int,
pktSentACK : int,
pktSentACKTotal : int,
pktSentNAK : int,
pktSentNAKTotal : int,
pktSentTotal : int,
pktSndBuf : int,
pktSndDrop : int,
pktSndDropTotal : int,
pktSndFilterExtra : int,
pktSndFilterExtraTotal : int,
pktSndLoss : int,
pktSndLossTotal : int,
usPktSndPeriod : float,
usSndDuration : int,
usSndDurationTotal : int},
bstats : (?clear : bool?) ->
{
byteAvailRcvBuf : int,
byteAvailSndBuf : int,
byteMSS : int,
byteRcvBuf : int,
byteRcvDrop : int,
byteRcvDropTotal : int,
byteRcvUndecrypt : int,
byteRcvUndecryptTotal : int,
byteRecv : int,
byteRecvTotal : int,
byteRetrans : int,
byteRetransTotal : int,
byteSent : int,
byteSentTotal : int,
byteSndBuf : int,
byteSndDrop : int,
byteSndDropTotal : int,
mbpsBandwidth : float,
mbpsMaxBW : float,
mbpsRecvRate : float,
mbpsSendRate : float,
msRTT : float,
msRcvBuf : int,
msRcvTsbPdDelay : int,
msSndBuf : int,
msSndTsbPdDelay : int,
msTimeStamp : int,
pktCongestionWindow : int,
pktFlightSize : int,
pktFlowWindow : int,
pktRcvAvgBelatedTime : float,
pktRcvBelated : int,
pktRcvBuf : int,
pktRcvDrop : int,
pktRcvDropTotal : int,
pktRcvFilterExtra : int,
pktRcvFilterExtraTotal : int,
pktRcvFilterLoss : int,
pktRcvFilterLossTotal : int,
pktRcvFilterSupply : int,
pktRcvFilterSupplyTotal : int,
pktRcvLoss : int,
pktRcvLossTotal : int,
pktRcvRetrans : int,
pktRcvUndecrypt : int,
pktRcvUndecryptTotal : int,
pktRecv : int,
pktRecvACK : int,
pktRecvACKTotal : int,
pktRecvNAK : int,
pktRecvNAKTotal : int,
pktRecvTotal : int,
pktReorderDistance : int,
pktRetrans : int,
pktRetransTotal : int,
pktSent : int,
pktSentACK : int,
pktSentACKTotal : int,
pktSentNAK : int,
pktSentNAKTotal : int,
pktSentTotal : int,
pktSndBuf : int,
pktSndDrop : int,
pktSndDropTotal : int,
pktSndFilterExtra : int,
pktSndFilterExtraTotal : int,
pktSndLoss : int,
pktSndLossTotal : int,
usPktSndPeriod : float,
usSndDuration : int,
usSndDurationTotal : int},
close : () -> unit,
pbkeylen : () -> int,
read_data : () -> int,
read_latency : () -> int,
read_timeout : () -> int,
status : () -> string,
streamid : () -> string,
write_timeout : () -> int
}) -> bool)?,
?max_clients : int?, ?messageapi : bool, ?mode : string,
?on_connect : (() -> unit), ?on_disconnect : (() -> unit),
?on_start : (() -> unit), ?on_stop : (() -> unit), ?passphrase : string?,
?payload_size : int, ?pbkeylen : int?, ?polling_delay : float, ?port : int,
?read_timeout : float?, ?start : bool, ?streamid : string?,
?write_timeout : float?, format('a), source('a)) -> unit
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.bind_address
(of typestring
, which defaults to"0.0.0.0"
): Address to bind on the local machine. Used only in listener modeconnection_timeout
(of typefloat?
, which defaults tonull
): Timeout, in seconds, after which initial connection operations are aborted if no data was received. Uses library’s default ifnulll
. Used only inclient
mode.enforced_encryption
(of typebool?
, which defaults tonull
): Enforces that both connection parties have the same passphrase set, or both do not set the passphrase, otherwise the connection is rejected.fallible
(of typebool
, which defaults tofalse
): Allow the child source to fail, in which case the output will be stopped until the source is available again.host
(of typestring
, which defaults to"localhost"
): Address to connect to. Used only in caller mode.listen_callback
(of type((hs_version : int, peeraddr : string, streamid : string?, srt_socket .{ bistats : (?clear : bool?, ?instantaneous : bool?) -> { byteAvailRcvBuf : int, byteAvailSndBuf : int, byteMSS : int, byteRcvBuf : int, byteRcvDrop : int, byteRcvDropTotal : int, byteRcvUndecrypt : int, byteRcvUndecryptTotal : int, byteRecv : int, byteRecvTotal : int, byteRetrans : int, byteRetransTotal : int, byteSent : int, byteSentTotal : int, byteSndBuf : int, byteSndDrop : int, byteSndDropTotal : int, mbpsBandwidth : float, mbpsMaxBW : float, mbpsRecvRate : float, mbpsSendRate : float, msRTT : float, msRcvBuf : int, msRcvTsbPdDelay : int, msSndBuf : int, msSndTsbPdDelay : int, msTimeStamp : int, pktCongestionWindow : int, pktFlightSize : int, pktFlowWindow : int, pktRcvAvgBelatedTime : float, pktRcvBelated : int, pktRcvBuf : int, pktRcvDrop : int, pktRcvDropTotal : int, pktRcvFilterExtra : int, pktRcvFilterExtraTotal : int, pktRcvFilterLoss : int, pktRcvFilterLossTotal : int, pktRcvFilterSupply : int, pktRcvFilterSupplyTotal : int, pktRcvLoss : int, pktRcvLossTotal : int, pktRcvRetrans : int, pktRcvUndecrypt : int, pktRcvUndecryptTotal : int, pktRecv : int, pktRecvACK : int, pktRecvACKTotal : int, pktRecvNAK : int, pktRecvNAKTotal : int, pktRecvTotal : int, pktReorderDistance : int, pktRetrans : int, pktRetransTotal : int, pktSent : int, pktSentACK : int, pktSentACKTotal : int, pktSentNAK : int, pktSentNAKTotal : int, pktSentTotal : int, pktSndBuf : int, pktSndDrop : int, pktSndDropTotal : int, pktSndFilterExtra : int, pktSndFilterExtraTotal : int, pktSndLoss : int, pktSndLossTotal : int, usPktSndPeriod : float, usSndDuration : int, usSndDurationTotal : int}, bstats : (?clear : bool?) -> { byteAvailRcvBuf : int, byteAvailSndBuf : int, byteMSS : int, byteRcvBuf : int, byteRcvDrop : int, byteRcvDropTotal : int, byteRcvUndecrypt : int, byteRcvUndecryptTotal : int, byteRecv : int, byteRecvTotal : int, byteRetrans : int, byteRetransTotal : int, byteSent : int, byteSentTotal : int, byteSndBuf : int, byteSndDrop : int, byteSndDropTotal : int, mbpsBandwidth : float, mbpsMaxBW : float, mbpsRecvRate : float, mbpsSendRate : float, msRTT : float, msRcvBuf : int, msRcvTsbPdDelay : int, msSndBuf : int, msSndTsbPdDelay : int, msTimeStamp : int, pktCongestionWindow : int, pktFlightSize : int, pktFlowWindow : int, pktRcvAvgBelatedTime : float, pktRcvBelated : int, pktRcvBuf : int, pktRcvDrop : int, pktRcvDropTotal : int, pktRcvFilterExtra : int, pktRcvFilterExtraTotal : int, pktRcvFilterLoss : int, pktRcvFilterLossTotal : int, pktRcvFilterSupply : int, pktRcvFilterSupplyTotal : int, pktRcvLoss : int, pktRcvLossTotal : int, pktRcvRetrans : int, pktRcvUndecrypt : int, pktRcvUndecryptTotal : int, pktRecv : int, pktRecvACK : int, pktRecvACKTotal : int, pktRecvNAK : int, pktRecvNAKTotal : int, pktRecvTotal : int, pktReorderDistance : int, pktRetrans : int, pktRetransTotal : int, pktSent : int, pktSentACK : int, pktSentACKTotal : int, pktSentNAK : int, pktSentNAKTotal : int, pktSentTotal : int, pktSndBuf : int, pktSndDrop : int, pktSndDropTotal : int, pktSndFilterExtra : int, pktSndFilterExtraTotal : int, pktSndLoss : int, pktSndLossTotal : int, usPktSndPeriod : float, usSndDuration : int, usSndDurationTotal : int}, close : () -> unit, pbkeylen : () -> int, read_data : () -> int, read_latency : () -> int, read_timeout : () -> int, status : () -> string, streamid : () -> string, write_timeout : () -> int }) -> bool)?
, which defaults tonull
): Callback used to decide whether to accept new incoming connections. Used in listener mode only.max_clients
(of typeint?
, which defaults tonull
): Max number of connected clients (listener mode only)messageapi
(of typebool
, which defaults totrue
): Use message apimode
(of typestring
, which defaults to"caller"
): Mode to operate on. One of:"listener"
(waits for connection to come in) or"caller"
(initiate connection to a remote server)on_connect
(of type() -> unit
, which defaults to{()}
): Function to execute when connected.on_disconnect
(of type() -> unit
, which defaults to{()}
): Function to execute when disconnectedon_start
(of type() -> unit
, which defaults to{()}
): Callback executed when output starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when output stops.passphrase
(of typestring?
, which defaults tonull
): When set to a non-empty string, this option enables encryption and sets the passphrase for it. Seelibsrt
documentation for more details.payload_size
(of typeint
, which defaults to1316
): Payload size.pbkeylen
(of typeint?
, which defaults tonull
): Set encryption key length. Seelibsrt
documentation for more details.polling_delay
(of typefloat
, which defaults to2.
): Delay between connection attempts. Used only in caller mode.port
(of typeint
, which defaults to8000
): Port to bind on the local machine (listener mode) or to connect to (caller mode). The termport
as used in SRT is occasionally identical to the termUDP port
. However SRT offers more flexibility than UDP because it manages ports as its own resources. For example, one port may be shared between various services.read_timeout
(of typefloat?
, which defaults to1.
): Timeout, in seconds, after which read operations are aborted if no data was received, indefinite ifnull
.start
(of typebool
, which defaults totrue
): Start output as soon as it is available.streamid
(of typestring?
, which defaults tonull
): Setstreamid
. This value can be retrieved by the listener side when connecting to it. Used in caller mode only.write_timeout
(of typefloat?
, which defaults to1.
): Timeout, in seconds, after which write operations are aborted if no data was received, indefinite ifnull
.(unlabeled)
(of typeformat('a)
): Encoding format.(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.sockets
(of type() -> [string * srt_socket .{ bistats : (?clear : bool?, ?instantaneous : bool?) -> { byteAvailRcvBuf : int, byteAvailSndBuf : int, byteMSS : int, byteRcvBuf : int, byteRcvDrop : int, byteRcvDropTotal : int, byteRcvUndecrypt : int, byteRcvUndecryptTotal : int, byteRecv : int, byteRecvTotal : int, byteRetrans : int, byteRetransTotal : int, byteSent : int, byteSentTotal : int, byteSndBuf : int, byteSndDrop : int, byteSndDropTotal : int, mbpsBandwidth : float, mbpsMaxBW : float, mbpsRecvRate : float, mbpsSendRate : float, msRTT : float, msRcvBuf : int, msRcvTsbPdDelay : int, msSndBuf : int, msSndTsbPdDelay : int, msTimeStamp : int, pktCongestionWindow : int, pktFlightSize : int, pktFlowWindow : int, pktRcvAvgBelatedTime : float, pktRcvBelated : int, pktRcvBuf : int, pktRcvDrop : int, pktRcvDropTotal : int, pktRcvFilterExtra : int, pktRcvFilterExtraTotal : int, pktRcvFilterLoss : int, pktRcvFilterLossTotal : int, pktRcvFilterSupply : int, pktRcvFilterSupplyTotal : int, pktRcvLoss : int, pktRcvLossTotal : int, pktRcvRetrans : int, pktRcvUndecrypt : int, pktRcvUndecryptTotal : int, pktRecv : int, pktRecvACK : int, pktRecvACKTotal : int, pktRecvNAK : int, pktRecvNAKTotal : int, pktRecvTotal : int, pktReorderDistance : int, pktRetrans : int, pktRetransTotal : int, pktSent : int, pktSentACK : int, pktSentACKTotal : int, pktSentNAK : int, pktSentNAKTotal : int, pktSentTotal : int, pktSndBuf : int, pktSndDrop : int, pktSndDropTotal : int, pktSndFilterExtra : int, pktSndFilterExtraTotal : int, pktSndLoss : int, pktSndLossTotal : int, usPktSndPeriod : float, usSndDuration : int, usSndDurationTotal : int}, bstats : (?clear : bool?) -> { byteAvailRcvBuf : int, byteAvailSndBuf : int, byteMSS : int, byteRcvBuf : int, byteRcvDrop : int, byteRcvDropTotal : int, byteRcvUndecrypt : int, byteRcvUndecryptTotal : int, byteRecv : int, byteRecvTotal : int, byteRetrans : int, byteRetransTotal : int, byteSent : int, byteSentTotal : int, byteSndBuf : int, byteSndDrop : int, byteSndDropTotal : int, mbpsBandwidth : float, mbpsMaxBW : float, mbpsRecvRate : float, mbpsSendRate : float, msRTT : float, msRcvBuf : int, msRcvTsbPdDelay : int, msSndBuf : int, msSndTsbPdDelay : int, msTimeStamp : int, pktCongestionWindow : int, pktFlightSize : int, pktFlowWindow : int, pktRcvAvgBelatedTime : float, pktRcvBelated : int, pktRcvBuf : int, pktRcvDrop : int, pktRcvDropTotal : int, pktRcvFilterExtra : int, pktRcvFilterExtraTotal : int, pktRcvFilterLoss : int, pktRcvFilterLossTotal : int, pktRcvFilterSupply : int, pktRcvFilterSupplyTotal : int, pktRcvLoss : int, pktRcvLossTotal : int, pktRcvRetrans : int, pktRcvUndecrypt : int, pktRcvUndecryptTotal : int, pktRecv : int, pktRecvACK : int, pktRecvACKTotal : int, pktRecvNAK : int, pktRecvNAKTotal : int, pktRecvTotal : int, pktReorderDistance : int, pktRetrans : int, pktRetransTotal : int, pktSent : int, pktSentACK : int, pktSentACKTotal : int, pktSentNAK : int, pktSentNAKTotal : int, pktSentTotal : int, pktSndBuf : int, pktSndDrop : int, pktSndDropTotal : int, pktSndFilterExtra : int, pktSndFilterExtraTotal : int, pktSndLoss : int, pktSndLossTotal : int, usPktSndPeriod : float, usSndDuration : int, usSndDurationTotal : int}, close : () -> unit, pbkeylen : () -> int, read_data : () -> int, read_latency : () -> int, read_timeout : () -> int, status : () -> string, streamid : () -> string, write_timeout : () -> int }]
): List of(connected_address, connected_socket)
start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
output.url
Encode and let encoder handle data output. Useful with encoder with
no expected output or to encode to files that need full control from the
encoder, e.g. %ffmpeg
with rtmp
output.
Type:
(?id : string?, ?fallible : bool,
?on_error : ((error
.{
kind : string,
message : string,
trace : [
{
position_end :
{
character_offset : int,
filename : string,
line_number : int
},
position_start :
{
character_offset : int,
filename : string,
line_number : int
},
to_string : (?prefix : string) -> string
}]
}) -> unit),
?on_start : (() -> unit), ?on_stop : (() -> unit), ?restart_delay : float?,
?self_sync : bool, ?start : bool, url : string, format('a), source('a)) ->
unit
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.fallible
(of typebool
, which defaults tofalse
): Allow the child source to fail, in which case the output will be stopped until the source is available again.on_error
(of type(error .{ kind : string, message : string, trace : [ { position_end : {character_offset : int, filename : string, line_number : int }, position_start : {character_offset : int, filename : string, line_number : int }, to_string : (?prefix : string) -> string }] }) -> unit
, which defaults to<fun>
): Callback executed when an error occurs.on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when output starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when output stops.restart_delay
(of typefloat?
, which defaults to2.
): If notnull
, restart output on errors after the given delay.self_sync
(of typebool
, which defaults tofalse
): Should the source control its own synchronization? Set totrue
for output to e.g.rtmp
output using%ffmpeg
and etc.start
(of typebool
, which defaults totrue
): Start output as soon as it is available.url
(of typestring
): Url to output to.(unlabeled)
(of typeformat('a)
): Encoding format.(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
output.video
Output a video stream using the default operator. The input source does not need to be infallible, blank will just be played during failures.
Type:
(?id : string?, ?fallible : bool, ?on_start : (() -> unit),
?on_stop : (() -> unit), ?start : bool, source(video=canvas('a), 'b)) ->
unit
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.fallible
(of typebool
, which defaults totrue
): Allow the child source to fail, in which case the output will be (temporarily) stopped.on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when outputting starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when outputting stops.start
(of typebool
, which defaults totrue
): Automatically start outputting whenever possible. Iftrue
, an infallible (normal) output will start outputting as soon as it is created, and a fallible output will (re)start as soon as its source becomes available for streaming.(unlabeled)
(of typesource(video=canvas('a), 'b)
): Source to play.
output.youtube.live.hls
Stream to youtube using HLS.
Type:
(?id : string?, ?fallible : bool, ?on_start : (() -> unit),
?on_stop : (() -> unit), ?segment_duration : float, ?segments : int,
?segments_overhead : int, ?start : bool, ?url : string, key : string,
encoder : format('a)
.{
bandwidth? : int,
codecs? : string,
extname? : string,
extra_tags? : [string],
id3? : bool,
id3_version? : int,
replay_id3? : bool,
video_size? : int * int
}, source('a)) -> unit
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.fallible
(of typebool
, which defaults tofalse
): Allow the child source to fail, in which case the output will be (temporarily) stopped.on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when outputting starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when outputting stops.segment_duration
(of typefloat
, which defaults to2.
): Segment duration (in seconds).segments
(of typeint
, which defaults to4
): Number of segments per playlist.segments_overhead
(of typeint
, which defaults to4
): Number of segments to keep after they have been featured in the live playlist.start
(of typebool
, which defaults totrue
): Automatically start outputting whenever possible. If true, an infallible (normal) output will start outputting as soon as it is created, and a fallible output will (re)start as soon as its source becomes available for streaming.url
(of typestring
, which defaults to"https://a.upload.youtube.com/http_upload_hls"
): HLS URL to stream tokey
(of typestring
): Your secret youtube keyencoder
(of typeformat('a) .{ bandwidth? : int, codecs? : string, extname? : string, extra_tags? : [string], id3? : bool, id3_version? : int, replay_id3? : bool, video_size? : int * int }
): Encoder to use (most likely a%ffmpeg
encoder)(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.streams
(of type() -> [ { bandwidth : int, codecs : string, discontinuity_count : int, encoder : format('A), extname : string, extra_tags : [string], id3_enabled : bool, insert_tag : (string) -> unit, name : string, replay_id3 : bool, video_size : {height : int, width : int }? }]
): Output streamstime
(of type() -> float
): Get a source’s time, based on its assigned clock.
output.youtube.live.rtmp
Stream to youtube using RTMP.
Type:
(?id : string?, ?fallible : bool, ?on_start : (() -> unit),
?on_stop : (() -> unit), ?start : bool, ?url : string, key : string,
encoder : format('a), source('a)) -> unit
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.fallible
(of typebool
, which defaults tofalse
): Allow the child source to fail, in which case the output will be (temporarily) stopped.on_start
(of type() -> unit
, which defaults to{()}
): Callback executed when outputting starts.on_stop
(of type() -> unit
, which defaults to{()}
): Callback executed when outputting stops.start
(of typebool
, which defaults totrue
): Automatically start outputting whenever possible. If true, an infallible (normal) output will start outputting as soon as it is created, and a fallible output will (re)start as soon as its source becomes available for streaming.url
(of typestring
, which defaults to"rtmp://a.rtmp.youtube.com/live2"
): RTMP URL to stream tokey
(of typestring
): Your secret youtube keyencoder
(of typeformat('a)
): Encoder to use (most likely a%ffmpeg
encoder)(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_started
(of type() -> bool
):true
if the output or source is started.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.shutdown
(of type() -> unit
): Shutdown the output or source.skip
(of type() -> unit
): Skip to the next track.start
(of type() -> unit
): Ask the source or output to start.stop
(of type() -> unit
): Ask the source or output to stop.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
Source / Sound synthesis
dssi.register
Register a DSSI plugin.
Type:
(string) -> unit
Arguments:
(unlabeled)
(of typestring
): Path of the DSSI plugin file.
synth.all.saw
Saw synthesizer. It creates one synthesizer for each channel.
Type:
(?id : string?, ?attack : float, ?decay : float, ?envelope : bool,
?release : float, ?sustain : float, source(midi=midi(channels=16), 'a)) ->
source(midi=midi(channels=16), 'a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.attack
(of typefloat
, which defaults to0.02
): Envelope attack (in seconds).decay
(of typefloat
, which defaults to0.01
): Envelope decay (in seconds).envelope
(of typebool
, which defaults totrue
): Use envelope.release
(of typefloat
, which defaults to0.01
): Envelope release (in seconds).sustain
(of typefloat
, which defaults to0.9
): Envelope sustain level.(unlabeled)
(of typesource(midi=midi(channels=16), 'a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
synth.all.sine
Sine synthesizer. It creates one synthesizer for each channel.
Type:
(?id : string?, ?attack : float, ?decay : float, ?envelope : bool,
?release : float, ?sustain : float, source(midi=midi(channels=16), 'a)) ->
source(midi=midi(channels=16), 'a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.attack
(of typefloat
, which defaults to0.02
): Envelope attack (in seconds).decay
(of typefloat
, which defaults to0.01
): Envelope decay (in seconds).envelope
(of typebool
, which defaults totrue
): Use envelope.release
(of typefloat
, which defaults to0.01
): Envelope release (in seconds).sustain
(of typefloat
, which defaults to0.9
): Envelope sustain level.(unlabeled)
(of typesource(midi=midi(channels=16), 'a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
synth.all.square
Square synthesizer. It creates one synthesizer for each channel.
Type:
(?id : string?, ?attack : float, ?decay : float, ?envelope : bool,
?release : float, ?sustain : float, source(midi=midi(channels=16), 'a)) ->
source(midi=midi(channels=16), 'a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.attack
(of typefloat
, which defaults to0.02
): Envelope attack (in seconds).decay
(of typefloat
, which defaults to0.01
): Envelope decay (in seconds).envelope
(of typebool
, which defaults totrue
): Use envelope.release
(of typefloat
, which defaults to0.01
): Envelope release (in seconds).sustain
(of typefloat
, which defaults to0.9
): Envelope sustain level.(unlabeled)
(of typesource(midi=midi(channels=16), 'a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
synth.saw
Saw synthesizer.
Type:
(?id : string?, ?attack : float, ?channel : int, ?decay : float,
?envelope : bool, ?release : float, ?sustain : float, ?volume : float,
source(midi=midi(channels=1), 'a)) -> source(midi=midi(channels=1), 'a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.attack
(of typefloat
, which defaults to0.02
): Envelope attack (in seconds).channel
(of typeint
, which defaults to0
): MIDI channel to handle.decay
(of typefloat
, which defaults to0.01
): Envelope decay (in seconds).envelope
(of typebool
, which defaults totrue
): Use envelope.release
(of typefloat
, which defaults to0.05
): Envelope release (in seconds).sustain
(of typefloat
, which defaults to0.9
): Envelope sustain level.volume
(of typefloat
, which defaults to0.3
): Initial volume.(unlabeled)
(of typesource(midi=midi(channels=1), 'a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
synth.sine
Sine synthesizer.
Type:
(?id : string?, ?attack : float, ?channel : int, ?decay : float,
?envelope : bool, ?release : float, ?sustain : float, ?volume : float,
source(midi=midi(channels=1), 'a)) -> source(midi=midi(channels=1), 'a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.attack
(of typefloat
, which defaults to0.02
): Envelope attack (in seconds).channel
(of typeint
, which defaults to0
): MIDI channel to handle.decay
(of typefloat
, which defaults to0.01
): Envelope decay (in seconds).envelope
(of typebool
, which defaults totrue
): Use envelope.release
(of typefloat
, which defaults to0.05
): Envelope release (in seconds).sustain
(of typefloat
, which defaults to0.9
): Envelope sustain level.volume
(of typefloat
, which defaults to0.3
): Initial volume.(unlabeled)
(of typesource(midi=midi(channels=1), 'a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
synth.square
Square synthesizer.
Type:
(?id : string?, ?attack : float, ?channel : int, ?decay : float,
?envelope : bool, ?release : float, ?sustain : float, ?volume : float,
source(midi=midi(channels=1), 'a)) -> source(midi=midi(channels=1), 'a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.attack
(of typefloat
, which defaults to0.02
): Envelope attack (in seconds).channel
(of typeint
, which defaults to0
): MIDI channel to handle.decay
(of typefloat
, which defaults to0.01
): Envelope decay (in seconds).envelope
(of typebool
, which defaults totrue
): Use envelope.release
(of typefloat
, which defaults to0.05
): Envelope release (in seconds).sustain
(of typefloat
, which defaults to0.9
): Envelope sustain level.volume
(of typefloat
, which defaults to0.3
): Initial volume.(unlabeled)
(of typesource(midi=midi(channels=1), 'a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
Source / Testing
sleeper
Sleep regularly, thus inducing delays in the sound production. This is mainly useful for emulating network delays or sources which are slow to produce data, and thus test bufferization and robustness of scripts.
Type:
(?every : float, ?delay : float, ?delay_random : float,
?on_delay : ((float) -> unit), source('a)) -> source('a)
Arguments:
every
(of typefloat
, which defaults to1.
): How often we should sleep (in seconds, 0 means every frame).delay
(of typefloat
, which defaults to1.1
): Delay introduced (in seconds).delay_random
(of typefloat
, which defaults to0.
): Maximum amount of time randomly added to the delay (in seconds).on_delay
(of type(float) -> unit
, which defaults tofun (_) -> ()
): Function called when a delay is introduced, with the delay as argument.(unlabeled)
(of typesource('a)
): Source in which the delays should be introduced.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.frozen
(of type(() -> bool).{set : (bool) -> unit}
): The stream production is frozen while set totrue
.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
This function is experimental.
Source / Track processing
append
Append an extra track to every track. Set the metadata ‘liq_append’ to ‘false’ to inhibit appending on one track.
Type:
(?id : string?, ?insert_missing : bool, ?merge : bool, source('a),
(([string * string]) -> source('a))) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.insert_missing
(of typebool
, which defaults totrue
): Treat track beginnings without metadata as having empty one.merge
(of typebool
, which defaults tofalse
): Merge the track with its appended track.(unlabeled)
(of typesource('a)
)(unlabeled)
(of type([string * string]) -> source('a)
): 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.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.cancel_pending
(of type() -> unit
): Cancel any pending appended source.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type(?cancel_pending : bool) -> unit
): Skip the current track. Pending appended source are cancelled by default. Passcancel_pending=false
to keep it.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
blank.detect
Calls a given handler when detecting a blank.
Type:
(?id : string?, ?max_blank : {float}, ?min_noise : {float},
?on_noise : (() -> unit), ?start_blank : bool, ?threshold : {float},
?track_sensitive : {bool}, (() -> unit), source(audio=pcm('a), 'b)) ->
source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.max_blank
(of type{float}
, which defaults to20.
): Maximum duration of silence allowed, in seconds.min_noise
(of type{float}
, which defaults to0.
): Minimum duration of noise required to end silence, in seconds.on_noise
(of type() -> unit
, which defaults to{()}
): Handler called when noise is detected.start_blank
(of typebool
, which defaults tofalse
): Start assuming we have blank.threshold
(of type{float}
, which defaults to-40.
): Power in decibels under which the stream is considered silent.track_sensitive
(of type{bool}
, which defaults totrue
): Reset blank counter at each track.(unlabeled)
(of type() -> unit
): Handler called when blank is detected.(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_blank
(of type() -> bool
): Indicate whether blank was detected.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
blank.eat
Eat blanks, i.e., drop the contents of the stream until it is not blank anymore.
Type:
(?id : string?, ?at_beginning : bool, ?max_blank : {float},
?min_noise : {float}, ?start_blank : bool, ?threshold : {float},
?track_sensitive : {bool}, source(audio=pcm('a), 'b)) ->
source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.at_beginning
(of typebool
, which defaults tofalse
): Only eat at the beginning of a track.max_blank
(of type{float}
, which defaults to20.
): Maximum duration of silence allowed, in seconds.min_noise
(of type{float}
, which defaults to0.
): Minimum duration of noise required to end silence, in seconds.start_blank
(of typebool
, which defaults tofalse
): Start assuming we have blank.threshold
(of type{float}
, which defaults to-40.
): Power in decibels under which the stream is considered silent.track_sensitive
(of type{bool}
, which defaults totrue
): Reset blank counter at each track.(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_blank
(of type() -> bool
): Indicate whether blank was detected.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
blank.skip
Skip track when detecting a blank.
Type:
(?id : string?, ?threshold : float, ?max_blank : float, ?min_noise : float,
?track_sensitive : bool, source(audio=pcm('a), 'b).{skip : () -> unit}) ->
source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults to"blank.skip"
): Force the value of the source ID.threshold
(of typefloat
, which defaults to-40.
): Power in decibels under which the stream is considered silent.max_blank
(of typefloat
, which defaults to20.
): Maximum silence length allowed, in seconds.min_noise
(of typefloat
, which defaults to0.
): Minimum duration of noise required to end silence, in seconds.track_sensitive
(of typebool
, which defaults totrue
): Reset blank counter at each track.(unlabeled)
(of typesource(audio=pcm('a), 'b).{skip : () -> unit}
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_blank
(of type() -> bool
): Indicate whether blank was detected.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
blank.strip
Make the source unavailable when it is streaming blank.
Type:
(?id : string?, ?max_blank : {float}, ?min_noise : {float},
?start_blank : bool, ?threshold : {float}, ?track_sensitive : {bool},
source(audio=pcm('a), 'b)) -> source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.max_blank
(of type{float}
, which defaults to20.
): Maximum duration of silence allowed, in seconds.min_noise
(of type{float}
, which defaults to0.
): Minimum duration of noise required to end silence, in seconds.start_blank
(of typebool
, which defaults tofalse
): Start assuming we have blank.threshold
(of type{float}
, which defaults to-40.
): Power in decibels under which the stream is considered silent.track_sensitive
(of type{bool}
, which defaults totrue
): Reset blank counter at each track.(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_blank
(of type() -> bool
): Indicate whether blank was detected.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
cue_cut
Start track after a cue in point and stop it at cue out point. The cue points are given as metadata, in seconds from the beginning of tracks.
Type:
(?id : string?, ?cue_in_metadata : string, ?cue_out_metadata : string,
?on_cue_in : (() -> unit), ?on_cue_out : (() -> unit), source('a)) ->
source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.cue_in_metadata
(of typestring
, which defaults to"liq_cue_in"
): Metadata for cue in points.cue_out_metadata
(of typestring
, which defaults to"liq_cue_out"
): Metadata for cue out points.on_cue_in
(of type() -> unit
, which defaults to{()}
): Callback to execute on cue inon_cue_out
(of type() -> unit
, which defaults to{()}
): Callback to execute on cue out(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
delay
Make the source unavailable for a given time between tracks.
Type:
(?id : string?, ?initial : bool, {float}, source('a)) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.initial
(of typebool
, which defaults tofalse
): Start in unavailable state, as if a track had just finished.(unlabeled)
(of type{float}
): The source won’t be ready less than this amount of seconds after any end of track(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
fallback
At the beginning of each track, select the first ready child.
Type:
(?id : string?, ?override : string, ?replay_metadata : bool,
?track_sensitive : bool, ?transition_length : float,
?transitions : [(source('a), source('a)) -> source('a)], [source('a)]) ->
source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.override
(of typestring
, which defaults to"liq_transition_length"
): Metadata field which, if present and containing a float, overrides thetransition_length
parameter.replay_metadata
(of typebool
, which defaults totrue
): Replay the last metadata of a child when switching to it in the middle of a track.track_sensitive
(of typebool
, which defaults totrue
): Re-select only on end of tracks.transition_length
(of typefloat
, which defaults to5.
): Maximum transition duration.transitions
(of type[(source('a), source('a)) -> source('a)]
, which defaults to[]
): Transition functions, padded withfun (x,y) -> y
functions.(unlabeled)
(of type[source('a)]
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).selected
(of type() -> source('A)?
): Currently selected source.self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
insert_metadata
Dynamically insert metadata in a stream. Returns the source decorated
with a method insert_metadata
which is a function of type
(?new_track,metadata)->unit
, used to insert metadata in
the source. This function also inserts a new track with the given
metadata if passed new_track=true
.
Type:
(?id : string?, source('a)) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.insert_metadata
(of type(?new_track : bool, [string * string]) -> unit
): Insert metadata in the source. Thenew_track
parameter indicates whether a track boundary should also be inserted (by default, no track is inserted).is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
max_duration
Limit source duration
Type:
(?id : string?, ?override : string, float, source('a)) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.override
(of typestring
, which defaults to"liq_remaining"
): Metadata field which, if present and containing a float, overrides the remaining play time.(unlabeled)
(of typefloat
): Maximum duration(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
metadata.map
Rewrite metadata on the fly using a function.
Type:
(?id : string?, ?update : bool, ?strip : bool, ?insert_missing : bool,
(([string * string]) -> [string * string]), source('a)) -> source('a)
where 'a is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults to"metadata.map"
): Force the value of the track ID.update
(of typebool
, which defaults totrue
): Update metadata. If false, existing metadata are cleared and only returned values are set as new metadata.strip
(of typebool
, which defaults tofalse
): Completely remove empty metadata. Operates on both empty values and empty metadata chunk.insert_missing
(of typebool
, which defaults totrue
): Treat track beginnings without metadata as having empty ones. The operational order is: create empty if needed, map and strip if enabled.(unlabeled)
(of type([string * string]) -> [string * string]
)(unlabeled)
(of typesource('a) where 'a is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
mksafe
Turn a source into an infaillible source by adding blank when the source is not available.
Type:
(?id : string, source('a)) -> source('a) where 'a is a set of internal tracks
Arguments:
id
(of typestring
, which defaults to"mksafe"
)(unlabeled)
(of typesource('a) where 'a is a set of internal tracks
): the source to turn infaillible
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).selected
(of type() -> source('A)? where 'A is a set of internal tracks
): Currently selected source.self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
on_offset
Call a given handler when position in track is equal or more than a given amount of time.
Type:
(?id : string?, ?force : bool, ?offset : float, ?override : string,
((float, [string * string]) -> unit), source('a)) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.force
(of typebool
, which defaults tofalse
): Force execution of callback if track ends before ‘offset’ position has been reached.offset
(of typefloat
, which defaults to-1.
): Execute handler when position in track is equal or more than to this value.override
(of typestring
, which defaults to"liq_on_offset"
): Metadata field which, if present and containing a float, overrides the ‘offset’ parameter.(unlabeled)
(of type(float, [string * string]) -> unit
): Function to execute. First argument is the actual position within the current track, second is the latest metadata. That function should be fast because it is executed in the main streaming thread.(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
once
Creates a source that plays only one track of the input source.
Type:
(?id : string?, source('a)) -> source('a)
Arguments:
id
(of typestring?
, which defaults to"once"
)(unlabeled)
(of typesource('a)
): The input source.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
prepend
Prepend an extra track before every track. Set the metadata ‘liq_prepend’ to ‘false’ to inhibit prepending on one track.
Type:
(?id : string?, ?merge : bool, source('a),
(([string * string]) -> source('a))) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.merge
(of typebool
, which defaults tofalse
): Merge the track with its appended track.(unlabeled)
(of typesource('a)
)(unlabeled)
(of type([string * string]) -> source('a)
): 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 or it will not be taken into account.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
random
At the beginning of every track, select a random ready child.
Type:
(?id : string?, ?override : string, ?replay_metadata : bool,
?transition_length : float,
?transitions : [(source('a), source('a)) -> source('a)], ?weights :
[{int}], [source('a)]) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.override
(of typestring
, which defaults to"liq_transition_length"
): Metadata field which, if present and containing a float, overrides thetransition_length
parameter.replay_metadata
(of typebool
, which defaults totrue
): Replay the last metadata of a child when switching to it in the middle of a track.transition_length
(of typefloat
, which defaults to5.
): Maximum transition duration.transitions
(of type[(source('a), source('a)) -> source('a)]
, which defaults to[]
): Transition functions, padded withfun (x,y) -> y
functions.weights
(of type[{int}]
, which defaults to[]
): Weights of the children (padded with 1), defining for each child the probability that it is selected.(unlabeled)
(of type[source('a)]
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).selected
(of type() -> source('A)?
): Currently selected source.self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
request.player
Create a source on which plays immediately requests given with the
play
method.
Type:
(?simultaneous : bool) -> source('a) where 'a is a set of internal tracks
Arguments:
simultaneous
(of typebool
, which defaults totrue
): Allow multiple requests to play simultaneously. Iffalse
a new request replaces the previous one.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.length
(of type() -> int
): Number of currently playing requests.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.play
(of type(request) -> unit
): Play a request.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.set
(of type(source('A)) -> unit where 'A is a set of internal tracks
): Set the source.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
request.queue
Play a queue of requests (the first added request gets played first).
Type:
(?id : string?, ?interactive : bool, ?prefetch : int, ?native : bool,
?queue : [request], ?timeout : float) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.interactive
(of typebool
, which defaults totrue
): Should the queue be controllable via telnet?prefetch
(of typeint
, which defaults to1
): How many requests should be queued in advance.native
(of typebool
, which defaults tofalse
): Use native implementation, when available.queue
(of type[request]
, which defaults to[]
): Initial queue of requests.timeout
(of typefloat
, which defaults to20.
): Timeout (in sec.) for a single download.
Methods:
add
(of type(request) -> bool
): This method is internal and should not be used. Consider usingpush
instead.buffered
(of type() -> [string * float]
): Length of buffered data.current
(of type() -> request?
): Get the request currently being played.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.fetch
(of type() -> bool
): Try feeding the queue with a new request. Returnstrue
if successful. This method can take long to return and should usually be run in a separate thread.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.length
(of type() -> int
): Length of the queue.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.push
(of type((request) -> unit).{uri : (string) -> unit}
): Push a request on the request queue.queue
(of type() -> [request]
): Get the requests currently in the queue.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.set_queue
(of type([request]) -> unit
):skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
rotate
Rotate between sources.
Type:
(?id : string?, ?override : string, ?replay_metadata : bool,
?transition_length : float,
?transitions : [(source('a), source('a)) -> source('a)], ?weights :
[{int}], [source('a)]) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.override
(of typestring
, which defaults to"liq_transition_length"
): Metadata field which, if present and containing a float, overrides thetransition_length
parameter.replay_metadata
(of typebool
, which defaults totrue
): Replay the last metadata of a child when switching to it in the middle of a track.transition_length
(of typefloat
, which defaults to5.
): Maximum transition duration.transitions
(of type[(source('a), source('a)) -> source('a)]
, which defaults to[]
): Transition functions, padded withfun (x,y) -> y
functions.weights
(of type[{int}]
, which defaults to[]
): Weights of the children (padded with 1), defining for each child how many tracks are played from it per round, if that many are actually available.(unlabeled)
(of type[source('a)]
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).selected
(of type() -> source('A)?
): Currently selected source.self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
sequence
Play only one track of every successive source, except for the last one which is played as much as available.
Type:
(?id : string?, ?merge : bool, [source('a)]) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.merge
(of typebool
, which defaults tofalse
): Merge tracks when advancing from one source to the next one. This will NOT merge consecutive tracks from the last source; see merge_tracks() if you need that too.(unlabeled)
(of type[source('a)]
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
source.audio
Create an audio source from the given track, with metadata and track marks from that same track.
Type:
(?id : string?, 'a) -> source(audio='a) where 'a is a track
Arguments:
id
(of typestring?
, which defaults to"source.audio"
)(unlabeled)
(of typeanything that is a track
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
source.available
Change the availability of a source depending on a predicate.
Type:
(?id : string?, ?override : bool, ?track_sensitive : {bool}, source('a),
{bool}) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.override
(of typebool
, which defaults tofalse
): Don’t take availability of original source in account (this can be dangerous and should be avoided).track_sensitive
(of type{bool}
, which defaults tofalse
): Change availability only on end of tracks.(unlabeled)
(of typesource('a)
): Source of which the availability should be changed.(unlabeled)
(of type{bool}
): Predicate indicating whether the source should be available or not.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
source.drop.audio
Remove the audio track of a source.
Type:
(?id : string?, source(audio='a, 'b)) -> source('b)
where 'b is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults tonull
)(unlabeled)
(of typesource(audio='a, 'b) where 'b is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
source.drop.metadata
Remove the metadata track of a source.
Type:
(?id : string?, source('a)) -> source('a)
where 'a is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults tonull
)(unlabeled)
(of typesource('a) where 'a is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
source.drop.midi
Remove the midi track of a source.
Type:
(?id : string?, source(midi='a, 'b)) -> source('b)
where 'b is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults tonull
)(unlabeled)
(of typesource(midi='a, 'b) where 'b is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
source.drop.video
Remove the video track of a source.
Type:
(?id : string?, source(video='a, 'b)) -> source('b)
where 'b is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults tonull
)(unlabeled)
(of typesource(video='a, 'b) where 'b is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
source.dynamic
Dynamically change the underlying source: it can either be changed by
the function given as argument, which returns the source to be played,
or by calling the set
method.
Type:
(?id : string?, ?infallible : bool, ?init : source('a)?,
?resurection_time : float?, ?track_sensitive : bool, ?(() -> source('a)?)) ->
source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.infallible
(of typebool
, which defaults tofalse
): Whether the source is infallible or not (be careful when setting this, it will not be checked by the typing system).init
(of typesource('a)?
, which defaults tonull
): Initial value for the sourceresurection_time
(of typefloat?
, which defaults to1.
): When track sensitive and the source is unavailable, how long we should wait before trying to update source again (null
means never).track_sensitive
(of typebool
, which defaults tofalse
): Whether the source should only be updated on track change.(unlabeled)
(of type() -> source('a)?
, which defaults to<fun>
): Function returning the source to be used,null
means keep current source.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.set
(of type(source('A)) -> unit
): Set the source.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
This function is experimental.
source.frame.duration
Compute the duration of the last frame.
Type:
(?id : string?, source('a)) -> source(frame_duration=float, 'a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.frame_duration
(of typefloat
): Compute the duration of the last frame.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
source.frame.rms
Compute the rms of the last frame.
Type:
(?id : string?, source('a)) -> source(frame_rms=float, 'a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.frame_rms
(of typefloat
): Compute the rms of the last frame.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
source.mux.audio
Replace the audio track of a source by the one of another source.
Type:
(?id : string?, audio : source(audio='A, 'B), source('c)) -> source(audio='A,
'c) where 'c is a set of tracks to be muxed into a source, 'A is a track
Arguments:
id
(of typestring?
, which defaults tonull
)audio
(of typesource(audio='B, 'A) where 'B is a track
): Source whose audio track is to be taken.(unlabeled)
(of typesource('c) where 'c is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
source.mux.midi
Replace the midi track of a source by the one of another source.
Type:
(?id : string?, midi : source(midi='A, 'B), source('c)) -> source(midi='A,
'c) where 'c is a set of tracks to be muxed into a source, 'A is a track
Arguments:
id
(of typestring?
, which defaults tonull
)midi
(of typesource(midi='B, 'A) where 'B is a track
): Source whose midi track is to be taken.(unlabeled)
(of typesource('c) where 'c is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
source.mux.track.audio
Replace the audio track of a source.
Type:
(?id : string?, audio : 'a, source('b)) -> source(audio='a, 'b)
where 'b is a set of tracks to be muxed into a source, 'a is a track
Arguments:
id
(of typestring?
, which defaults tonull
)audio
(of typeanything that is a track
)(unlabeled)
(of typesource('b) where 'b is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
source.mux.track.video
Replace the video track of a source.
Type:
(?id : string?, video : 'a, source('b)) -> source(video='a, 'b)
where 'b is a set of tracks to be muxed into a source, 'a is a track
Arguments:
id
(of typestring?
, which defaults tonull
)video
(of typeanything that is a track
)(unlabeled)
(of typesource('b) where 'b is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
source.mux.video
Replace the video track of a source by the one of another source.
Type:
(?id : string?, video : source(video='A, 'B), source('c)) -> source(video='A,
'c) where 'c is a set of tracks to be muxed into a source, 'A is a track
Arguments:
id
(of typestring?
, which defaults tonull
)video
(of typesource(video='B, 'A) where 'B is a track
)(unlabeled)
(of typesource('c) where 'c is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
source.on_end
Call a given handler when there is less than a given amount of time remaining before then end of track.
Type:
(?id : string?, ?delay : {float}, source('a),
((float, [string * string]) -> unit)) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.delay
(of type{float}
, which defaults to5.
): Execute handler when remaining time is less or equal to this value.(unlabeled)
(of typesource('a)
)(unlabeled)
(of type(float, [string * string]) -> unit
): Function to execute. First argument is the remaining time, second is the latest metadata. That function should be fast because it is executed in the main streaming thread.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
source.on_frame
Call a given handler on every frame.
Type:
(?id : string?, source('a), (() -> unit)) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.(unlabeled)
(of typesource('a)
)(unlabeled)
(of type() -> unit
): Function called on every frame. It should be fast because it is executed in the main streaming thread.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
source.on_metadata
Call a given handler on metadata packets.
Type:
(?id : string?, source('a), (([string * string]) -> unit)) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.(unlabeled)
(of typesource('a)
)(unlabeled)
(of type([string * string]) -> unit
): Function called on every metadata packet in the stream. It should be fast because it is executed in the main streaming thread.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
source.on_track
Call a given handler on new tracks.
Type:
(?id : string?, source('a), (([string * string]) -> unit)) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.(unlabeled)
(of typesource('a)
)(unlabeled)
(of type([string * string]) -> unit
): Function called on every beginning of track in the stream, with the corresponding metadata as argument. If there is no metadata at the beginning of track, the empty list is passed. That function should be fast because it is executed in the main streaming thread.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
source.run
Run a function regularly. This is similar to thread.run
but based on a source internal time instead of the computer’s time.
Type:
(source('a), ?delay : float, ?every : float?, (() -> unit)) -> source('a)
Arguments:
(unlabeled)
(of typesource('a)
): Source whose time is taken as reference.delay
(of typefloat
, which defaults to0.
): Time to wait before the first run (in seconds).every
(of typefloat?
, which defaults tonull
): How often to run the function (in seconds). The function is run once ifnull
.(unlabeled)
(of type() -> unit
): Function to run.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
source.tracks
Return the tracks of a given source.
Type:
(source('a)) -> 'a
Arguments:
(unlabeled)
(of typesource('a)
)
Methods:
metadata
(of typemetadata
)track_marks
(of typetrack_marks
)
source.video
Create a video source from the given track, with metadata and track marks from that same track.
Type:
(?id : string?, 'a) -> source(video='a) where 'a is a track
Arguments:
id
(of typestring?
, which defaults to"source.video"
)(unlabeled)
(of typeanything that is a track
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
switch
At the beginning of a track, select the first source whose predicate is true.
Type:
(?id : string?, ?all_predicates : bool, ?override : string,
?replay_metadata : bool, ?single : [bool], ?track_sensitive : {bool},
?transition_length : float,
?transitions : [(source('a), source('a)) -> source('a)],
[(() -> bool) * source('a)]) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.all_predicates
(of typebool
, which defaults tofalse
): Always evaluate all predicates when re-selecting.override
(of typestring
, which defaults to"liq_transition_length"
): Metadata field which, if present and containing a float, overrides thetransition_length
parameter.replay_metadata
(of typebool
, which defaults totrue
): Replay the last metadata of a child when switching to it in the middle of a track.single
(of type[bool]
, which defaults to[]
): Forbid the selection of a branch for two tracks in a row. The empty list stands for[false,...,false]
.track_sensitive
(of type{bool}
, which defaults totrue
): Re-select only on end of tracks.transition_length
(of typefloat
, which defaults to5.
): Maximum transition duration.transitions
(of type[(source('a), source('a)) -> source('a)]
, which defaults to[]
): Transition functions, padded withfun (x,y) -> y
functions.(unlabeled)
(of type[(() -> bool) * source('a)]
): Sources with the predicate telling when they can be played.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).selected
(of type() -> source('A)?
): Currently selected source.self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
Source / Video processing
image
Generate a source from a static image.
Type:
(?id : string?, ?fallible : bool, ?width : {int}?, ?height : {int}?,
?x : {int}, ?y : {int}, {string}) -> source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.fallible
(of typebool
, which defaults tofalse
): Whether we are allowed to fail (in case the file is non-existent or invalid).width
(of type{int}?
, which defaults tonull
): Scale to widthheight
(of type{int}?
, which defaults tonull
): Scale to heightx
(of type{int}
, which defaults to0
): x position.y
(of type{int}
, which defaults to0
): y position.(unlabeled)
(of type{string}
): Path to the image.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.set
(of type(string) -> unit
): Change the image.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.add_image
Add a static image on the source video channel.
Type:
(?id : string?, ?width : {int}?, ?height : {int}?, ?x : {int}, ?y : {int},
file : {string}, source(video=canvas('a), 'b)) -> source(video=canvas('a),
'b) where 'b is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults to"video.add_image"
): Force the value of the source ID.width
(of type{int}?
, which defaults tonull
): Scale to widthheight
(of type{int}?
, which defaults tonull
): Scale to heightx
(of type{int}
, which defaults to0
): x position.y
(of type{int}
, which defaults to0
): y position.file
(of type{string}
): Path to the image file.(unlabeled)
(of typesource(video=canvas('a), 'b) where 'b is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.add_line
Draw a line on the video.
Type:
(?id : string?, ?alpha : {float}, ?color : {int}, {int * int}, {int * int},
source(video=canvas('a), 'b)) -> source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.alpha
(of type{float}
, which defaults to1.
): Transparency of the color between 0 and 1 (0 is fully transparent and 1 is fully opaque).color
(of type{int}
, which defaults to0
): Color to fill the image with (0xRRGGBB).(unlabeled)
(of type{int * int}
): Start point.(unlabeled)
(of type{int * int}
): End point.(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.add_rectangle
Draw a rectangle.
Type:
(?id : string?, ?alpha : {float}, ?color : {int}, height : {int},
width : {int}, ?x : {int}, ?y : {int}, source(video=canvas('a), 'b)) ->
source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.alpha
(of type{float}
, which defaults to1.
): Transparency of the color between 0 and 1 (0 is fully transparent and 1 is fully opaque).color
(of type{int}
, which defaults to0
): Color to fill the image with (0xRRGGBB).height
(of type{int}
): Height.width
(of type{int}
): Width.x
(of type{int}
, which defaults to0
): Horizontal offset.y
(of type{int}
, which defaults to0
): Vertical offset.(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.add_subtitle
Add subtitle from metadata.
Type:
(?override : string, ?size : int, ?color : int, ?offset : int,
source(video=canvas('A), 'a)) -> source(video=canvas('A), 'a)
where 'a is a set of tracks to be muxed into a source
Arguments:
override
(of typestring
, which defaults to"subtitle"
): Metadata where subtitle to display are located.size
(of typeint
, which defaults to18
)color
(of typeint
, which defaults to16777215
)offset
(of typeint
, which defaults to20
): Offset in pixels.(unlabeled)
(of typesource(video=canvas('A), 'a) where 'a is a set of tracks to be muxed into a source
): Source.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.add_text
Add a text to a stream. Uses the first available operator in: camlimages, SDL, FFmpeg, GStreamer, gd or native.
Type:
(?id : string?, ?duration : float?, ?color : int, ?cycle : bool,
?font : {string}?, ?metadata : string?, ?size : int, ?speed : int,
?x : {int}, ?y : {int}, ?on_cycle : (() -> unit), {string},
source(video=canvas('A), 'a).{is_ready : () -> bool}) ->
source(video=canvas('A), 'a)
where 'a is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.duration
(of typefloat?
, which defaults tonull
)color
(of typeint
, which defaults to16777215
): Text color (in 0xRRGGBB format).cycle
(of typebool
, which defaults totrue
): Cycle text when it reaches left boundary.font
(of type{string}?
, which defaults tonull
): Path to ttf font file.metadata
(of typestring?
, which defaults tonull
): Change text on a particular metadata (empty string means disabled).size
(of typeint
, which defaults to18
): Font size.speed
(of typeint
, which defaults to0
): Horizontal speed in pixels per second (0
means no scrolling and update according tox
andy
in case they are variable).x
(of type{int}
, which defaults to10
): x offset.y
(of type{int}
, which defaults to10
): y offset.on_cycle
(of type() -> unit
, which defaults to{()}
): Function called when text is cycling.(unlabeled)
(of type{string}
): d Text to display.(unlabeled)
(of typesource(video=canvas('A), 'a).{is_ready : () -> bool} where 'a is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.add_text.ffmpeg.internal
Display a text.
Type:
(?id : string?, ?color : int, ?cycle : bool, ?font : string?,
?duration : float?, ?metadata : string?, ?size : int, ?speed : int,
?x : {int}, ?y : {int}, {string}, source(audio=pcm('b), video=canvas('a))) ->
source(audio=pcm('c), video=canvas('d))
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.color
(of typeint
, which defaults to16777215
): Text color (in 0xRRGGBB format).cycle
(of typebool
, which defaults totrue
): Cycle text when it reaches left boundary.font
(of typestring?
, which defaults tonull
): Path to ttf font file.duration
(of typefloat?
, which defaults tonull
)metadata
(of typestring?
, which defaults tonull
): Change text on a particular metadata (empty string means disabled).size
(of typeint
, which defaults to18
): Font size.speed
(of typeint
, which defaults to70
): Horizontal speed in pixels per second (0 means no scrolling and update according to x and y in case they are variable).x
(of type{int}
, which defaults to10
): x offset.y
(of type{int}
, which defaults to10
): y offset.(unlabeled)
(of type{string}
): d Text to display.(unlabeled)
(of typesource(audio=pcm('b), video=canvas('a))
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.add_text.ffmpeg.raw
Display a text. Use this operator inside ffmpeg filters with a input source
Type:
(?color : int, ?cycle : bool, ?font : string?, ?metadata : string?,
?size : int, ?speed : int, ?x : {int}, ?y : {int},
graph : ffmpeg.filter.graph, ?{string}, source(video=ffmpeg.video.raw('a),
'b)) -> ffmpeg.filter.video
Arguments:
color
(of typeint
, which defaults to16777215
): Text color (in 0xRRGGBB format).cycle
(of typebool
, which defaults totrue
): Cycle text when it reaches left boundary.font
(of typestring?
, which defaults tonull
): Path to ttf font file.metadata
(of typestring?
, which defaults tonull
): Change text on a particular metadata (empty string means disabled).size
(of typeint
, which defaults to18
): Font size.speed
(of typeint
, which defaults to70
): Horizontal speed in pixels per second (0 means no scrolling and update according to x and y in case they are variable).x
(of type{int}
, which defaults to10
): x offset.y
(of type{int}
, which defaults to10
): y offset.graph
(of typeffmpeg.filter.graph
): a ffmpeg filter graph to attach this filter to.(unlabeled)
(of type{string}
, which defaults to""
): d Text to display.(unlabeled)
(of typesource(video=ffmpeg.video.raw('a), 'b)
)
video.add_text.ffmpeg.raw.filter
Display a text. Use this operator inside ffmpeg filters with a ffmpeg
video input Returns a ffmpeg video output with on_change
and on_metadata
methods to be used to update the output
text.
Type:
(?color : int, ?cycle : bool, ?font : string?, ?metadata : string?,
?size : int, ?speed : int, ?x : {int}, ?y : {int},
graph : ffmpeg.filter.graph, ?{string}, ffmpeg.filter.video) ->
ffmpeg.filter.video
Arguments:
color
(of typeint
, which defaults to16777215
): Text color (in 0xRRGGBB format).cycle
(of typebool
, which defaults totrue
): Cycle text when it reaches left boundary.font
(of typestring?
, which defaults tonull
): Path to ttf font file.metadata
(of typestring?
, which defaults tonull
): Change text on a particular metadata (empty string means disabled).size
(of typeint
, which defaults to18
): Font size.speed
(of typeint
, which defaults to70
): Horizontal speed in pixels per second (0 means no scrolling and update according to x and y in case they are variable).x
(of type{int}
, which defaults to10
): x offset.y
(of type{int}
, which defaults to10
): y offset.graph
(of typeffmpeg.filter.graph
): a ffmpeg filter graph to attach this filter to.(unlabeled)
(of type{string}
, which defaults to""
): d Text to display.(unlabeled)
(of typeffmpeg.filter.video
)
Methods:
on_change
(of type() -> unit
): Method to call when parameters have changed to update the filter’s rendered out, including when text changes.on_metadata
(of type([string * string]) -> unit
): Method to call on new metadata.
video.add_text.native
Add a text to a stream (native implementation).
Type:
(?id : string?, ?duration : float?, ?color : {int}, ?cycle : bool,
?font : {string}?, ?metadata : string?, ?size : {int}, ?speed : int,
?x : {int}, ?y : {int}, ?on_cycle : (() -> unit), {string},
source(video=canvas('B), 'A).{is_ready : () -> bool}) ->
source(video=canvas('B), 'A)
where 'A is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.duration
(of typefloat?
, which defaults tonull
)color
(of type{int}
, which defaults to16777215
): Text color (in 0xRRGGBB format).cycle
(of typebool
, which defaults totrue
): Cycle text when it reaches left boundary.font
(of type{string}?
, which defaults tonull
): Path to ttf font file.metadata
(of typestring?
, which defaults tonull
): Change text on a particular metadata (empty string means disabled).size
(of type{int}
, which defaults to18
): Font size.speed
(of typeint
, which defaults to0
): Horizontal speed in pixels per second (0
means no scrolling and update according tox
andy
in case they are variable).x
(of type{int}
, which defaults to10
): x offset.y
(of type{int}
, which defaults to10
): y offset.on_cycle
(of type() -> unit
, which defaults to{()}
)(unlabeled)
(of type{string}
): d Text to display.(unlabeled)
(of typesource(video=canvas('B), 'A).{is_ready : () -> bool} where 'A is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.add_text.sdl
Add a text to a stream (SDL implementation).
Type:
(?id : string?, ?duration : float?, ?color : {int}, ?cycle : bool,
?font : {string}?, ?metadata : string?, ?size : {int}, ?speed : int,
?x : {int}, ?y : {int}, ?on_cycle : (() -> unit), {string},
source(video=canvas('B), 'A).{is_ready : () -> bool}) ->
source(video=canvas('B), 'A)
where 'A is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.duration
(of typefloat?
, which defaults tonull
)color
(of type{int}
, which defaults to16777215
): Text color (in 0xRRGGBB format).cycle
(of typebool
, which defaults totrue
): Cycle text when it reaches left boundary.font
(of type{string}?
, which defaults tonull
): Path to ttf font file.metadata
(of typestring?
, which defaults tonull
): Change text on a particular metadata (empty string means disabled).size
(of type{int}
, which defaults to18
): Font size.speed
(of typeint
, which defaults to0
): Horizontal speed in pixels per second (0
means no scrolling and update according tox
andy
in case they are variable).x
(of type{int}
, which defaults to10
): x offset.y
(of type{int}
, which defaults to10
): y offset.on_cycle
(of type() -> unit
, which defaults to{()}
)(unlabeled)
(of type{string}
): d Text to display.(unlabeled)
(of typesource(video=canvas('B), 'A).{is_ready : () -> bool} where 'A is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.align
Translate the video so that it is aligned on boundaries.
Type:
(?id : string?, ?bottom : bool, ?left : bool, ?right : bool, ?top : bool,
source(video=canvas('a), 'b)) -> source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.bottom
(of typebool
, which defaults tofalse
): Align bottom.left
(of typebool
, which defaults tofalse
): Align left.right
(of typebool
, which defaults tofalse
): Align right.top
(of typebool
, which defaults tofalse
): Align top.(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.alpha.movement
Make moving parts visible and non-moving parts transparent. A cheap way to have a bluescreen.
Type:
(?id : string?, ?precision : float, source(video=canvas('a), 'b)) ->
source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.precision
(of typefloat
, which defaults to0.2
): Precision when comparing pixels to those of previous image (between 0 and 1).(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.alpha.of_color
Set a color to be transparent.
Type:
(?id : string?, ?color : int, ?precision : float, source(video=canvas('a),
'b)) -> source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.color
(of typeint
, which defaults to0
): Color which should be transparent (in 0xRRGGBB format).precision
(of typefloat
, which defaults to0.2
): Precision in color matching (0. means match precisely the color and 1. means match every color).(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.alpha.remove
Remove α channel.
Type:
(?id : string?, source(video=canvas('a), 'b)) -> source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.alpha.to_y
Convert the α channel to Y channel, thus converting opaque (resp. transparent) pixels to bright (resp. dark) ones. This is useful to observe the α channel.
Type:
(?id : string?, source(video=canvas('a), 'b)) -> source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.board
A plane where one can draw.
Type:
(?id : string?, ?height : int?, ?width : int?) -> source('a)
where 'a is a set of internal tracks
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.height
(of typeint?
, which defaults tonull
): Initial height of the video (defaults ot the same as frame).width
(of typeint?
, which defaults tonull
): Initial width of the video (defaults ot the same as frame).
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.clear
(of type() -> unit
): Clear the board.clear_and_copy
(of type(?x : int, ?y : int) -> unit
): Clear the board and copy the old board to the new one, translated.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.fill
(of type(int) -> unit
): Fill with given color (0xRRGGBB).height
(of type() -> int
): Current height of the board.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.line_to
(of type(?color : int, int, int) -> unit
): Draw a line from the last point.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.pixel
(of type(int, int) -> (() -> int).{set : (int) -> unit}
): Retrieve a pixel whose contents is a color (in 0xRRGGBB format).remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.width
(of type() -> int
): Current width of the board.
video.bounding_box
Retrieve the origin (methods x
/ y
) and the
dimensions (methods width
/ height
) of the
bounding box of the video.
Type:
(?id : string?, source(video=canvas('a), 'b)) -> source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.height
(of type() -> int
): Height of video.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.width
(of type() -> int
): Width of video.x
(of type() -> int
): x offset of video.y
(of type() -> int
): y offset of video.
video.color
Generate a video filled with given color.
Type:
({int}) -> source(video=canvas('a), 'b) where 'b is a set of internal tracks
Arguments:
(unlabeled)
(of type{int}
): Color (in 0xRRGGBB format).
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.cover
Generate a video source containing cover-art for current track of input audio source.
Type:
('b.{on_track : ((([string * string]) -> unit)) -> 'a}) ->
source(video=canvas('c))
Arguments:
(unlabeled)
(of type'b.{on_track : ((([string * string]) -> unit)) -> 'a}
): Audio source whose metadata contain cover-art.
video.crop
Make the viewport of the current video match its bounding box.
Type:
(?id : string?, source(video=canvas('a), 'b)) -> source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.fade.in
Fade the beginning of tracks. Metadata ‘liq_video_fade_in’ can be used to set the duration for a specific track (float in seconds).
Type:
(?id : string?, ?duration : float, ?override : string, ?transition : string,
?type : string, source(video=canvas('a), 'b)) -> source(video=canvas('a),
'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.duration
(of typefloat
, which defaults to3.
): Duration of the fading. This value can be set on a per-file basis using the metadata field passed as override.override
(of typestring
, which defaults to"liq_video_fade_in"
): Metadata field which, if present and containing a float, overrides the ‘duration’ parameter for current track.transition
(of typestring
, which defaults to"fade"
): Kind of transition (fade|slide_left|slide_right|slide_up|slide_down|grow|disc|random).type
(of typestring
, which defaults to"lin"
): Fader shape (lin|sin|log|exp): linear, sinusoidal, logarithmic or exponential.(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.fade.out
Fade the end of tracks. Metadata ‘liq_video_fade_out’ can be used to set the duration for a specific track (float in seconds).
Type:
(?id : string?, ?duration : float, ?override : string, ?transition : string,
?type : string, source(video=canvas('a), 'b)) -> source(video=canvas('a),
'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.duration
(of typefloat
, which defaults to3.
): Duration of the fading. This value can be set on a per-file basis using the metadata field passed as override.override
(of typestring
, which defaults to"liq_video_fade_out"
): Metadata field which, if present and containing a float, overrides the ‘duration’ parameter for current track.transition
(of typestring
, which defaults to"fade"
): Kind of transition (fade|slide_left|slide_right|slide_up|slide_down|grow|disc|random).type
(of typestring
, which defaults to"lin"
): Fader shape (lin|sin|log|exp): linear, sinusoidal, logarithmic or exponential.(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.fill
Fill frame with a color.
Type:
(?id : string?, ?alpha : {float}, ?color : {int}, source(video=canvas('a),
'b)) -> source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.alpha
(of type{float}
, which defaults to1.
): Transparency of the color between 0 and 1 (0 is fully transparent and 1 is fully opaque).color
(of type{int}
, which defaults to0
): Color to fill the image with (0xRRGGBB).(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.frame.height
Height for all video frames.
Type:
() -> int
video.frame.rate
Framerate for all video frames.
Type:
() -> int
video.frame.width
Width for all video frames.
Type:
() -> int
video.greyscale
Convert video to greyscale.
Type:
(?id : string?, source(video=canvas('a), 'b)) -> source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.hmirror
Flip image horizontally.
Type:
(?id : string?, source(video=canvas('a), 'b)) -> source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.info
Compute various information about the video (dimension, size, etc.). Those are accessible through the methods attached to the source.
Type:
(?id : string?, source(video=canvas('a), 'b)) -> source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.height
(of type() -> int
): Height of video.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.planes
(of type() -> int
): Number of planes in a video frame.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.size
(of type() -> int
): Size of a video frame (in bytes).skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.width
(of type() -> int
): Width of video.
video.invert
Invert video.
Type:
(?id : string?, source(video=canvas('a), 'b)) -> source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.lomo
Emulate the “Lomo effect”.
Type:
(?id : string?, source(video=canvas('a), 'b)) -> source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.opacity
Scale opacity of video.
Type:
(?id : string?, {float}, source(video=canvas('a), 'b)) ->
source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.(unlabeled)
(of type{float}
): Coefficient to scale opacity with.(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.opacity.box
Set alpha value on a given box inside the image.
Type:
(?id : string?, alpha : {float}, height : {int}, width : {int}, ?x : {int},
?y : {int}, source(video=canvas('a), 'b)) -> source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.alpha
(of type{float}
): alpha value.height
(of type{int}
): Box height.width
(of type{int}
): Box width.x
(of type{int}
, which defaults to0
): x offset.y
(of type{int}
, which defaults to0
): y offset.(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.persistence
Make images of the video persistent.
Type:
(?id : string?, ?duration : {float}, source(video=canvas('a), 'b)) ->
source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.duration
(of type{float}
, which defaults to1.
): Persistence duration in seconds.(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.plot
Plot a floating point value.
Type:
(?lines : bool, ?min : float, ?max : float, ?speed : float, ?color : int,
(() -> float)) -> source(video=canvas('a), 'b)
where 'b is a set of internal tracks
Arguments:
lines
(of typebool
, which defaults totrue
): Draw lines connecting plotted points.min
(of typefloat
, which defaults to0.
): Minimal value of the parameter.max
(of typefloat
, which defaults to1.
): Maximal value of the parameter.speed
(of typefloat
, which defaults to100.
): Speed in pixels per second.color
(of typeint
, which defaults to16777215
): Color of the drawn point (in 0xRRGGBB format).(unlabeled)
(of type() -> float
): Value to plot.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.render
Render the video by computing the result of its canvas images.
Type:
(?id : string?, ?transparent : bool, source(video=canvas('a), 'b)) ->
source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.transparent
(of typebool
, which defaults totrue
): Make uncovered portions of the image transparent (they are black by default).(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.resize
Resize and translate video.
Type:
(?id : string?, ?height : {int}?, ?proportional : bool, ?width : {int}?,
?x : {int}, ?y : {int}, source(video=canvas('a), 'b)) ->
source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.height
(of type{int}?
, which defaults tonull
): Target height (null
means original height).proportional
(of typebool
, which defaults totrue
): Keep original proportions.width
(of type{int}?
, which defaults tonull
): Target width (null
means original width).x
(of type{int}
, which defaults to0
): x offset.y
(of type{int}
, which defaults to0
): y offset.(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.rotate
Rotate video.
Type:
(?id : string?, ?angle : {float}, source(video=canvas('a), 'b)) ->
source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.angle
(of type{float}
, which defaults to0.
): Angle in radians.(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.scale
Scale and translate video.
Type:
(?id : string?, ?scale : {float}, ?x : {int}, ?xscale : {float}, ?y : {int},
?yscale : {float}, source(video=canvas('a), 'b)) -> source(video=canvas('a),
'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.scale
(of type{float}
, which defaults to1.
): Scaling coefficient in both directions.x
(of type{int}
, which defaults to0
): x offset.xscale
(of type{float}
, which defaults to1.
): x scaling.y
(of type{int}
, which defaults to0
): y offset.yscale
(of type{float}
, which defaults to1.
): y scaling.(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.sepia
Convert video to sepia.
Type:
(?id : string?, source(video=canvas('a), 'b)) -> source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.slideshow
Display a slideshow (typically of pictures).
Type:
(?id : string?, ?cyclic : {bool}, ?advance : {float}, ?[string]) ->
source('a)
Arguments:
id
(of typestring?
, which defaults tonull
)cyclic
(of type{bool}
, which defaults totrue
): Go to the first picture after the last.advance
(of type{float}
, which defaults to-1.
): Skip to the next file after this amount of time in seconds (negative means never).(unlabeled)
(of type[string]
, which defaults to[]
): List of files to display.
Methods:
append
(of type([string]) -> unit
): Append a list of files to the slideshow.buffered
(of type() -> [string * float]
): Length of buffered data.clear
(of type() -> unit
): Clear the list of files in the slideshow.current
(of type() -> string
): Currently displayed file.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.next
(of type() -> unit
): Go to next file.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.prev
(of type() -> unit
): Go to previous file.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.set
(of type(source('A)) -> unit
): Set the source.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.still_frame
Take still frames from a video source by calling the
save
method. For now only bitmap output is supported.
Type:
(?id : string?, source(video=canvas('a), 'b)) -> source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.save
(of type(string) -> unit
): Save current image, argument is the file name to save to.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.testsrc.ffmpeg
A test video source, which generates various patterns.
Type:
(?id : string?, ?pattern : string, ?max_buffer : float, ?duration : 'a?) ->
source(video=canvas('b))
Arguments:
id
(of typestring?
, which defaults tonull
)pattern
(of typestring
, which defaults to"testsrc"
): Pattern drawn in the video:"testsrc"
,"testsrc2"
,"smptebars"
,"pal75bars"
,"pal100bars"
,"smptehdbars"
,"yuvtestsrc"
or"rgbtestsrc"
and more. Support any of the patterns supported byffmpeg
.max_buffer
(of typefloat
, which defaults to0.5
): Maximum data buffer in secondsduration
(of type'a?
, which defaults tonull
): Duration of the source.
video.text
Display a text using the first available operator in: camlimages, SDL, FFmpeg, GStreamer, gd or native.
Type:
(?id : string?, ?color : {int}, ?duration : float?, ?font : {string}?,
?size : {int}, {string}) -> source(video=canvas('A))
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.color
(of type{int}
, which defaults to16777215
): Text color (in 0xRRGGBB format).duration
(of typefloat?
, which defaults tonull
): Duration in seconds (null
means infinite).font
(of type{string}?
, which defaults tonull
): Path to ttf font file.size
(of type{int}
, which defaults to18
): Font size.(unlabeled)
(of type{string}
): Text to display.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.text.gd
Add a text to a stream (GD implementation).
Type:
(?id : string?, ?duration : float?, ?color : {int}, ?cycle : bool,
?font : {string}?, ?metadata : string?, ?size : {int}, ?speed : int,
?x : {int}, ?y : {int}, ?on_cycle : (() -> unit), {string},
source(video=canvas('B), 'A).{is_ready : () -> bool}) ->
source(video=canvas('B), 'A)
where 'A is a set of tracks to be muxed into a source
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.duration
(of typefloat?
, which defaults tonull
)color
(of type{int}
, which defaults to16777215
): Text color (in 0xRRGGBB format).cycle
(of typebool
, which defaults totrue
): Cycle text when it reaches left boundary.font
(of type{string}?
, which defaults tonull
): Path to ttf font file.metadata
(of typestring?
, which defaults tonull
): Change text on a particular metadata (empty string means disabled).size
(of type{int}
, which defaults to18
): Font size.speed
(of typeint
, which defaults to0
): Horizontal speed in pixels per second (0
means no scrolling and update according tox
andy
in case they are variable).x
(of type{int}
, which defaults to10
): x offset.y
(of type{int}
, which defaults to10
): y offset.on_cycle
(of type() -> unit
, which defaults to{()}
)(unlabeled)
(of type{string}
): d Text to display.(unlabeled)
(of typesource(video=canvas('B), 'A).{is_ready : () -> bool} where 'A is a set of tracks to be muxed into a source
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.text.native
Display a text.
Type:
(?id : string?, ?color : {int}, ?duration : float?, ?font : {string}?,
?size : {int}, {string}) -> source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.color
(of type{int}
, which defaults to16777215
): Text color (in 0xRRGGBB format).duration
(of typefloat?
, which defaults tonull
): Duration in seconds (null
means infinite).font
(of type{string}?
, which defaults tonull
): Path to ttf font file (default is"/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"
).size
(of type{int}
, which defaults to18
): Font size.(unlabeled)
(of type{string}
): Text to display.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.text.sdl
Display a text.
Type:
(?id : string?, ?color : {int}, ?duration : float?, ?font : {string}?,
?size : {int}, {string}) -> source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.color
(of type{int}
, which defaults to16777215
): Text color (in 0xRRGGBB format).duration
(of typefloat?
, which defaults tonull
): Duration in seconds (null
means infinite).font
(of type{string}?
, which defaults tonull
): Path to ttf font file (default is"/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"
).size
(of type{int}
, which defaults to18
): Font size.(unlabeled)
(of type{string}
): Text to display.
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.tile
Tile sources
Type:
(?id : string?, ?normalize : {bool}, ?power : {bool}, ?proportional : bool,
?weights : [{float}], [source(?audio=pcm('b), video=canvas('a), 'c)]) ->
source(?audio=pcm('b), video=canvas('a))
Arguments:
id
(of typestring?
, which defaults to"video.tile"
): Force the value of the track ID.normalize
(of type{bool}
, which defaults totrue
): Divide by the sum of weights of ready sources (or by the number of ready sources if weights are not specified).power
(of type{bool}
, which defaults tofalse
): Perform constant-power normalization.proportional
(of typebool
, which defaults totrue
): Scale preserving the proportions.weights
(of type[{float}]
, which defaults to[]
)(unlabeled)
(of type[source(?audio=pcm('b), video=canvas('a), 'c)]
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.translate
Translate video.
Type:
(?id : string?, ?x : {int}, ?y : {int}, source(video=canvas('a), 'b)) ->
source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.x
(of type{int}
, which defaults to0
): x offset.y
(of type{int}
, which defaults to0
): y offset.(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.viewport
Set the viewport for the current video.
Type:
(?id : string?, ?height : int?, ?width : int?, ?x : int, ?y : int,
source(video=canvas('a), 'b)) -> source(video=canvas('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.height
(of typeint?
, which defaults tonull
): height (default is frame height).width
(of typeint?
, which defaults tonull
): Width (default is frame width).x
(of typeint
, which defaults to0
): Horizontal offset.y
(of typeint
, which defaults to0
): Vertical offset.(unlabeled)
(of typesource(video=canvas('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
Source / Visualization
bpm
Detect the BPM (number of beats per minute). The returned source has
a method bpm
, which can be called to compute it.
Type:
(?id : string?, source(audio=pcm('a), 'b)) -> source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
bpm
(of type() -> float
): Compute the current BPM.buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
lufs
Compute current LUFS of the source according to the EBU R128 standard. It returns the source with a method to compute the current value.
Type:
(?id : string?, ?window : {float}, source(audio=pcm('a), 'b)) ->
source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.window
(of type{float}
, which defaults to3.
): Duration of the window (in seconds) used to compute the LUFS.(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.lufs
(of type() -> float
): Current value for the LUFS (short-term value computed over the duration specified by thewindow
parameter).lufs_momentary
(of type() -> float
): Momentary LUFS (over a 400ms window).on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
midi.inspect
Display midi events on standard output.
Type:
(?id : string?, source('a)) -> source('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.(unlabeled)
(of typesource('a)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
rms.smooth
Compute the current RMS for the source, this varies more smoothly
that rms
and is updated more frequently. Returns the source
with a method rms
.
Type:
(?id : string?, ?duration : {float}, source(audio=pcm('a), 'b)) ->
source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.duration
(of type{float}
, which defaults to0.5
): Duration of the window in seconds (more precisely, this is the time constant of the low-pass filter).(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.rms
(of type() -> float
): Current value for the RMS.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
video.volume
Graphical visualization of the sound.
Type:
(?id : string?, source(audio=pcm('a), 'b)) -> source(audio=pcm('a), 'b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the source ID.(unlabeled)
(of typesource(audio=pcm('a), 'b)
)
Methods:
buffered
(of type() -> [string * float]
): Length of buffered data.duration
(of type() -> float
): Estimation of the duration of the current track.elapsed
(of type() -> float
): Elapsed time in the current track.fallible
(of typebool
): Indicate if a source may fail, i.e. may not be ready to stream.id
(of type() -> string
): Identifier of the source.is_active
(of type() -> bool
):true
if the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,true
for outputs and sources such asinput.http
.is_ready
(of type() -> bool
): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up
(of type() -> bool
): Indicate that the source can be asked to produce some data at any time. This istrue
when the source is currently being used or if it could be used at any time, typically inside aswitch
orfallback
.last_metadata
(of type() -> [string * string]?
): Return the last metadata from the source.log
(of type{level : (() -> int?).{set : (int) -> unit}}
): Get or set the source’s log level, from1
to5
.on_metadata
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on metadata packets.on_shutdown
(of type((() -> unit)) -> unit
): Register a function to be called when source shuts down.on_track
(of type((([string * string]) -> unit)) -> unit
): Call a given handler on new tracks.on_wake_up
(of type((() -> unit)) -> unit
): Register a function to be called after the source is asked to get ready. This is when, for instance, the source’s final ID is set.remaining
(of type() -> float
): Estimation of remaining time in the current track.seek
(of type(float) -> float
): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync
(of type() -> bool
): Is the source currently controlling its own real-time loop.skip
(of type() -> unit
): Skip to the next track.time
(of type() -> float
): Get a source’s time, based on its assigned clock.
String
%
pattern % [...,(k,v),...]
changes in the pattern
occurrences of:
$(k)
intov
- `$(if $(k2),“a”,“b”) into “a” if k2 is found in the list, “b” otherwise.
Type:
(string, [string * string]) -> string
Arguments:
(unlabeled)
(of typestring
)(unlabeled)
(of type[string * string]
)
^
Concatenate strings.
Type:
(string, string) -> string
Arguments:
(unlabeled)
(of typestring
)(unlabeled)
(of typestring
)
bool_of_string
Convert a string to a bool. Raises
error.failure("a string to a bool")
if conversion fails and
default is null
Type:
(string, ?default : bool?) -> bool
Arguments:
(unlabeled)
(of typestring
)default
(of typebool?
, which defaults tonull
)
file.metadata.flac.cover.decode
Decode a flac-encoded cover metadata string.
Type:
(string) -> string
.{
color_depth : int,
description : string,
height : int,
mime : string,
number_of_colors : int?,
picture_type : int,
width : int}?
Arguments:
(unlabeled)
(of typestring
)
file.metadata.flac.cover.encode
Encode cover metadata for embedding with flac files.
Type:
(picture_type : int, mime : string, ?description : string, width : int,
height : int, color_depth : int, ?number_of_colors : int?, string) -> string
Arguments:
picture_type
(of typeint
)mime
(of typestring
)description
(of typestring
, which defaults to""
)width
(of typeint
)height
(of typeint
)color_depth
(of typeint
)number_of_colors
(of typeint?
, which defaults tonull
)(unlabeled)
(of typestring
)
float_of_string
Convert a string to a float. Raises
error.failure("a string to a float")
if conversion fails
and default is null
Type:
(string, ?default : float?) -> float
Arguments:
(unlabeled)
(of typestring
)default
(of typefloat?
, which defaults tonull
)
int_of_string
Convert a string to a int. Raises
error.failure("a string to a int")
if conversion fails and
default is null
Type:
(string, ?default : int?) -> int
Arguments:
(unlabeled)
(of typestring
)default
(of typeint?
, which defaults tonull
)
irc.channel
Contents of an IRC channel.
Type:
(?server : string, ?port : int, ?channel : string, ?nick : string,
?limit : int) -> () -> string
Example:
# Display messages in the #liquidsoap-test room over a video
s = single("test.mp4")
s = video.add_text.native(irc.channel(channel="#liquidsoap-test"), s)
Arguments:
server
(of typestring
, which defaults to"irc.libera.chat"
): IRC server.port
(of typeint
, which defaults to6667
): Port for IRC server.channel
(of typestring
, which defaults to"#liquidsoap"
): IRC chan to join.nick
(of typestring
, which defaults to"liquidbot"
): Nickname.limit
(of typeint
, which defaults to10
): Limit to n last messages
json
Create a generic json object
Type:
() -> json
Methods:
add
(of type(string, 'a) -> unit
): Add or replace a newkey
/value
pair to the object.remove
(of type(string) -> unit
): Remove a key from the object. Does not nothing if the key does not exist.stringify
(of type(?compact : bool, ?json5 : bool) -> string
): Render object as json string.
json.stringify
Convert a value to JSON. If the value cannot be represented as JSON
(for instance a function), a error.json
exception is
raised.
Type:
(?compact : bool, ?json5 : bool, 'a) -> string
Arguments:
compact
(of typebool
, which defaults tofalse
): Output compact text.json5
(of typebool
, which defaults tofalse
): Use json5 extended spec.(unlabeled)
(of type'a
)
metadata.id3v2.render
Return a string representation of a id3v2 metadata tag
Type:
([string * string], ?version : int) -> string
Arguments:
(unlabeled)
(of type[string * string]
)version
(of typeint
, which defaults to3
): Tag version. One of: 3 or 4
regexp
Create a regular expression
Type:
(?flags : [string], string) -> regexp
Arguments:
flags
(of type[string]
, which defaults to[]
): List of flags. Valid flags:"i"
,"g"
,"s"
,"m"
.(unlabeled)
(of typestring
)
Methods:
exec
(of type(string) -> [int * string].{groups : [string * string]}
): Extract substrings from a string. Returns a list of (index,value). If the list does not have a pair associated to some index, it means that the corresponding pattern was not found.replace
(of type(((string) -> string), string) -> string
): Replace substrings matched by the regexp by another string returned by a function.split
(of type(string) -> [string]
): Split a string on the given regular expression.test
(of type(string) -> bool
): Match a string with the expressionn.
runtime.mem_usage.prettify_bytes
Returns a human-redable description of an amount of bytes.
Type:
(?float_printer : ((float) -> string)?, ?signed : bool?, ?bits : bool?,
?binary : bool?, int) -> string
Arguments:
float_printer
(of type((float) -> string)?
, which defaults tonull
)signed
(of typebool?
, which defaults tonull
)bits
(of typebool?
, which defaults tonull
)binary
(of typebool?
, which defaults tonull
)(unlabeled)
(of typeint
)
string
Return the representation of a value.
Type:
(?fields : bool, 'a) -> string
Arguments:
fields
(of typebool
, which defaults tofalse
): Show toplevel fields around the value.(unlabeled)
(of type'a
)
string.annotate.parse
Parse a string of the form
<key>=<value>,...:<uri>
as given by the
annotate:
protocol
Type:
(string) -> [string * string] * string
Arguments:
(unlabeled)
(of typestring
)
string.base64.decode
Decode a Base64 encoded string.
Type:
(string) -> string
Arguments:
(unlabeled)
(of typestring
)
string.base64.encode
Encode a string in Base64.
Type:
(string) -> string
Arguments:
(unlabeled)
(of typestring
)
string.binary.of_int
Encode a positive (unsigned) integer using native memory representation.
Type:
(?pad : int, ?little_endian : bool, int) -> string
Arguments:
pad
(of typeint
, which defaults to0
): Minimum length in digits (pad on the left with zeros in order to reach it)little_endian
(of typebool
, which defaults totrue
): Whether the memory representation is little endian.(unlabeled)
(of typeint
): String containing the binary representation.
string.binary.to_int
Value of a positive (unsigned) integer encoded using native memory representation.
Type:
(?little_endian : bool, string) -> int
Arguments:
little_endian
(of typebool
, which defaults totrue
): Whether the memory representation is little endian.(unlabeled)
(of typestring
): String containing the binary representation.
string.capitalize
Return a string with the first character set to upper case (capitalize), or to lower case (uncapitalize).
Type:
(?capitalize : bool, ?space_sensitive : bool, string) -> string
Arguments:
capitalize
(of typebool
, which defaults totrue
): Capitalize if true, uncapitalize otherwisespace_sensitive
(of typebool
, which defaults totrue
): Capitalize each space separated sub-string.(unlabeled)
(of typestring
)
string.case
Convert a string to lower or upper case.
Type:
(?lower : bool, string) -> string
Arguments:
lower
(of typebool
, which defaults totrue
): Convert to lower case if true and uppercase otherwise.(unlabeled)
(of typestring
)
string.char
Create a string with one character.
Type:
(int) -> string
Arguments:
(unlabeled)
(of typeint
): Code of the character.
string.char.ascii.random
Return a random ASCII character
Type:
(?[int]) -> string
Arguments:
(unlabeled)
(of type[int]
, which defaults to[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127]
)
string.concat
Concatenate strings.
Type:
(?separator : string, [string]) -> string
Arguments:
separator
(of typestring
, which defaults to""
)(unlabeled)
(of type[string]
)
string.contains
Test whether a string contains a given prefix, substring or suffix.
Type:
(?prefix : string, ?substring : string, ?suffix : string, string) -> bool
Arguments:
prefix
(of typestring
, which defaults to""
): Prefix to look for.substring
(of typestring
, which defaults to""
): Substring to look for.suffix
(of typestring
, which defaults to""
): Suffix to look for.(unlabeled)
(of typestring
): The string to look into.
string.data_uri.decode
Decode a string using the data uri format,
i.e. "data:<mime>[;base64],<data>"
.
Type:
(string) -> string.{mime : string}?
Arguments:
(unlabeled)
(of typestring
)
string.data_uri.encode
Encode a string using the data uri format,
i.e. "data:<mime>[;base64],<data>"
.
Type:
(?base64 : bool, mime : string, string) -> string
Arguments:
base64
(of typebool
, which defaults totrue
): Encode data using the base64 formatmime
(of typestring
): Data mime type(unlabeled)
(of typestring
)
string.escape
Escape special characters in an string. By default, the string is
assumed to be "utf8"
encoded and is escaped following JSON
and javascript specification.
Type:
(?special_char : ((encoding : string, string) -> bool)?,
?escape_char : ((encoding : string, string) -> string)?,
?encoding : string?, string) -> string
Arguments:
special_char
(of type((encoding : string, string) -> bool)?
, which defaults tonull
): Returntrue
if the given character (passed as a string) should be escaped. Defaults to control characters for"utf8"
and control characters and any character above\x7E
(non-printable characters) for"ascii"
.escape_char
(of type((encoding : string, string) -> string)?
, which defaults tonull
): Function used to escape a character. Defaults to\xxx
octal notation for"ascii"
and\uxxxx
hexadecimal notation for"utf8"
.encoding
(of typestring?
, which defaults tonull
): One of:"ascii"
or"utf8"
. Ifnull
,utf8
is tried first andascii
is used as a fallback if this fails.(unlabeled)
(of typestring
)
string.escape.all
Escape each character in the given string using a specific escape sequence.
Type:
(?format : string, string) -> string
Arguments:
format
(of typestring
, which defaults to"utf8"
): Escape format. One of:"octal"
,"hex"
or"utf8"
.(unlabeled)
(of typestring
)
string.escape.html
Escape HTML entities.
Type:
(?encoding : string?, string) -> string
Arguments:
encoding
(of typestring?
, which defaults tonull
): One of:"ascii"
or"utf8"
. Ifnull
,utf8
is tried first andascii
is used as a fallback if this fails.(unlabeled)
(of typestring
)
string.escape.special_char
Default function to detect characters to escape. See
string.escape
for more details.
Type:
(?encoding : string, string) -> bool
Arguments:
encoding
(of typestring
, which defaults to"utf8"
): One of:"ascii"
or"utf8"
.(unlabeled)
(of typestring
)
string.extract
Extract substrings from a string. Perl compatible regular expressions
are recognized. Hence, special characters should be escaped. Returns a
list of (index,value). If the list does not have a pair associated to
some index, it means that the corresponding pattern was not found. Alter
natively, one can use the r/_/.exec(_)
syntax for regular
expressions.
Type:
(pattern : string, string) -> [int * string]
Arguments:
pattern
(of typestring
)(unlabeled)
(of typestring
)
Methods:
groups
(of type[string * string]
): Named captures
string.float
String representation of a float.
Type:
(?decimal_places : int?, float) -> string
Arguments:
decimal_places
(of typeint?
, which defaults tonull
): Number of decimal places.(unlabeled)
(of typefloat
)
string.getter.concat
Combine a list of string getters [g1, ...]
and return a
single getter g
such that:
string.getter.flush(separator=s, g) = string.concat(separator=s, list.filter(fun (s) -> s != "", [string.getter.flush(g1), ...]))
Type:
([{string}]) -> {string}
Arguments:
(unlabeled)
(of type[{string}]
)
string.getter.flush
Flush all values from a string getter and return the concatenated result. If the getter is constant, return the constant string. Otherwise, call the getter repeatedly until it returns an empty string and return the concatenated result
Type:
(?separator : string, {string}) -> string
Arguments:
separator
(of typestring
, which defaults to""
)(unlabeled)
(of type{string}
)
string.getter.single
Create a string getter which will return once the given string and then the empty string.
Type:
(string) -> () -> string
Arguments:
(unlabeled)
(of typestring
)
string.hex_of_int
Hexadecimal representation of an integer.
Type:
(?pad : int, int) -> string
Arguments:
pad
(of typeint
, which defaults to0
): Minimum length in digits (pad on the left with zeros in order to reach it).(unlabeled)
(of typeint
)
string.id
Generate an identifier with given operator name.
Type:
(string) -> string
Arguments:
(unlabeled)
(of typestring
): Operator name.
string.id.default
Generate an identifier if no identifier was provided.
Type:
(default : string, string?) -> string
Arguments:
default
(of typestring
): Name from which identifier is generated if not present.(unlabeled)
(of typestring?
): Proposed identifier.
string.index
Index where a substring occurs in a string. The function returns
-1
if the substring is not present
Type:
(substring : string, string) -> int
Arguments:
substring
(of typestring
): Substring to look for.(unlabeled)
(of typestring
): String in which to look.
string.is_int
Test whether a string is a valid integer.
Type:
(string) -> bool
Arguments:
(unlabeled)
(of typestring
)
string.length
Get the length of a string.
Type:
(string) -> int
Arguments:
(unlabeled)
(of typestring
)
string.make
Create a string of a given length using the given character.
Type:
(?char_code : int, int) -> string
Arguments:
char_code
(of typeint
, which defaults to32
): Character code.(unlabeled)
(of typeint
): String length.
string.match
Match a string with an expression. Perl compatible regular
expressions are recognized. Hence, special characters should be escaped.
Alternatively, one can use the the r/_/.test(_)
syntax for
regular expressions.
Type:
(pattern : string, string) -> bool
Arguments:
pattern
(of typestring
)(unlabeled)
(of typestring
)
string.nth
Retrieve a character in a string. Raises error.not_found
if character does not exist.
Type:
(string, int) -> int
Example:
c = string.nth("abcde", 2)
print(c) # should print 99 which is the ascii code for "c"
Arguments:
(unlabeled)
(of typestring
): String to look into.(unlabeled)
(of typeint
): Index of the character.
string.null_terminated
Add a null character at the end of a string.
Type:
(string) -> string
Arguments:
(unlabeled)
(of typestring
): String.
string.quote
Return a quoted copy of the given string. By default, the string is
assumed to be "utf8"
encoded and is escaped following JSON
and javascript specification.
Type:
(?encoding : string?, string) -> string
Arguments:
encoding
(of typestring?
, which defaults tonull
): One of:"ascii"
or"utf8"
. Ifnull
,utf8
is tried first andascii
is used as a fallback if this fails.(unlabeled)
(of typestring
)
string.recode
Convert a string. Effective only if Camomile is enabled.
Type:
(?in_enc : string?, ?out_enc : string, string) -> string
Arguments:
in_enc
(of typestring?
, which defaults tonull
): Input encoding. Autodetected if null.out_enc
(of typestring
, which defaults to"UTF-8"
): Output encoding.(unlabeled)
(of typestring
)
string.replace
Replace all substrings matched by a pattern by another string
returned by a function. Alternatively, one can use the
r/_/g.replace(_)
syntax for regular expressions.
Type:
(pattern : string, ((string) -> string), string) -> string
Arguments:
pattern
(of typestring
): Pattern (regular expression) of substrings which should be replaced.(unlabeled)
(of type(string) -> string
): Function getting a matched substring an returning the string to replace it with.(unlabeled)
(of typestring
): String whose substrings should be replaced.
string.residual
What remains of a string after a given prefix.
Type:
(prefix : string, string) -> string?
Arguments:
prefix
(of typestring
): Requested prefix.(unlabeled)
(of typestring
)
string.split
Split a string at “separator”. Perl compatible regular expressions
are recognized. Hence, special characters should be escaped.
Alternatively, one can use the r/_/.split(_)
syntax for
regular expressions.
Type:
(separator : string, string) -> [string]
Arguments:
separator
(of typestring
)(unlabeled)
(of typestring
)
string.split.first
Split a string in two at first “separator”.
Type:
(separator : string, string) -> string * string
Arguments:
separator
(of typestring
)(unlabeled)
(of typestring
)
string.sub
Get a substring of a string. Returns “” if no such substring exists.
Type:
(string, start : int, length : int) -> string
Arguments:
(unlabeled)
(of typestring
)start
(of typeint
): Return a sub string starting at this position. First position is 0.length
(of typeint
): Return a sub string oflength
characters.
string.to_float
Convert a string to a float.
Type:
(?default : float, string) -> float
Arguments:
default
(of typefloat
, which defaults to0.
)(unlabeled)
(of typestring
)
string.to_int
Convert a string to a int.
Type:
(?default : int, string) -> int
Arguments:
default
(of typeint
, which defaults to0
)(unlabeled)
(of typestring
)
string.trim
Return a string without leading and trailing whitespace.
Type:
(string) -> string
Arguments:
(unlabeled)
(of typestring
)
string.unescape
This function is the inverse of string.escape
.
Type:
(string) -> string
Arguments:
(unlabeled)
(of typestring
)
string.unquote
Return an unquoted copy of the given string. Quotes are removed by trying to parse the string following the JSON string escaping convention.
Type:
(string) -> string
Arguments:
(unlabeled)
(of typestring
)
string_of_metadata
Standard function for displaying metadata. Shows artist and title, using “Unknown” when a field is empty.
Type:
([string * string]) -> string
Arguments:
(unlabeled)
(of type[string * string]
): Metadata packet to be displayed.
url.decode
Decode an encoded url (e.g. “%20” becomes ” “).
Type:
(?plus : bool, string) -> string
Arguments:
plus
(of typebool
, which defaults totrue
)(unlabeled)
(of typestring
)
url.encode
Encode an url (e.g. ” ” becomes “%20”).
Type:
(?plus : bool, string) -> string
Arguments:
plus
(of typebool
, which defaults totrue
)(unlabeled)
(of typestring
)
url.split
Split an url of the form foo?arg=bar&arg2=bar2
into
("foo",[("arg","bar"),("arg2","bar2")])
. The returned
strings are decoded (see url.decode
).
Type:
(string) -> string * [string * string]
Arguments:
(unlabeled)
(of typestring
): Url to split.
url.split_args
Split the arguments of an url of the form
arg=bar&arg2=bar2
into
[("arg","bar"),("arg2","bar2")]
. The returned strings are
decoded (see url.decode
).
Type:
(string) -> [string * string]
Arguments:
(unlabeled)
(of typestring
): Argument string to split.
yaml.stringify
Convert a value to YAML. If the value cannot be represented as YAML
(for instance a function), a error.yaml
exception is
raised.
Type:
(?scalar_style : string, ?layout_style : string, 'a) -> string
Arguments:
scalar_style
(of typestring
, which defaults to"any"
): Scalar style. One of: “any”, “plain”, “single_quoted”, “double_quoted”, “literal” or “folded”.layout_style
(of typestring
, which defaults to"any"
): Layout style. One of: “any”, “block” or “flow”.(unlabeled)
(of type'a
)
System
argv
Get command-line parameters. The parameters are numbered starting from 1, the zeroth parameter being the script name.
Type:
(?default : string, int) -> string
Arguments:
default
(of typestring
, which defaults to""
)(unlabeled)
(of typeint
)
environment
Return the process environment.
Type:
() -> [string * string]
environment.get
Get the value of an environment variable. Returns
default
if the variable is not set.
Type:
(?default : string, string) -> string
Arguments:
default
(of typestring
, which defaults to""
)(unlabeled)
(of typestring
)
environment.set
Set the value associated to a variable in the process environment.
Type:
(string, string) -> unit
Arguments:
(unlabeled)
(of typestring
): Variable to be set.(unlabeled)
(of typestring
): Value to set.
exe_ext
Executable file extension.
Type:
string
exit
Immediately stop the application. This should only be used in extreme cases or to specify an exit value. The recommended way of stopping Liquidsoap is to use shutdown.
Type:
(int) -> unit
Arguments:
(unlabeled)
(of typeint
): Exit value.
getopt
Parse command line options: getopt("-o")
returns “1” if
“-o” was passed without any parameter, “0” otherwise.
getopt(default="X","-o")
returns “Y” if “-o Y” was passed,
“X” otherwise. The result is removed from the list of arguments,
affecting subsequent calls to argv()
and
getopt()
.
Type:
(?default : string, string) -> string
Arguments:
default
(of typestring
, which defaults to""
)(unlabeled)
(of typestring
)
on_cleanup
Register a function to be called for the final cleanup.
Type:
((() -> unit)) -> unit
Arguments:
(unlabeled)
(of type() -> unit
)
on_shutdown
Register a function to be called when Liquidsoap shuts down.
Type:
((() -> unit)) -> unit
Arguments:
(unlabeled)
(of type() -> unit
)
on_start
Register a function to be called when Liquidsoap starts.
Type:
((() -> unit)) -> unit
Arguments:
(unlabeled)
(of type() -> unit
)
os.type
Type of OS running liquidsoap.
Type:
string
process.pid
Get the process’ pid.
Type:
() -> int
process.quote
Return a quoted copy of the given string, suitable for use as one argument in a command line, escaping all meta-characters. Warning: under Windows, the output is only suitable for use with programs that follow the standard Windows quoting conventions.
Type:
(string) -> string
Arguments:
(unlabeled)
(of typestring
): String to escape
process.quote.command
Return a quoted command line, suitable for use as an argument to
process.run
.
The optional arguments stdin
, stdout
and
stderr
are file names used to redirect the standard input,
the standard output, or the standard error of the command.
If stdin=f
is given, a redirection < f
is performed and the standard input of the command reads from file
f
.
If stdout=f
is given, a redirection > f
is performed and the standard output of the command is written to file
f
.
If stderr=f
is given, a redirection 2> f
is performed and the standard error of the command is written to file
f
.
If both stdout=f
and stderr=f
are given,
with the exact same file name f
, a 2>&1
redirection is performed so that the standard output and the standard
error of the command are interleaved and redirected to the same file
f
.
Type:
(?stdin : string?, ?stdout : string?, ?stderr : string?, ?args : [string],
string) -> string
Arguments:
stdin
(of typestring?
, which defaults tonull
): command standard inputstdout
(of typestring?
, which defaults tonull
): command standard outputstderr
(of typestring?
, which defaults tonull
): command standard errorargs
(of type[string]
, which defaults to[]
): command arguments(unlabeled)
(of typestring
): Command to execute
process.read
Perform a shell call and return its output.
Type:
(?timeout : float, ?env : [string * string], ?inherit_env : bool,
?log_errors : bool, string) -> string
Arguments:
timeout
(of typefloat
, which defaults to-1.
): Cancel process aftertimeout
has elapsed. Ignored if negative.env
(of type[string * string]
, which defaults to[]
): Process environmentinherit_env
(of typebool
, which defaults totrue
): Inherit calling process’s environment whenenv
parameter is empty.log_errors
(of typebool
, which defaults totrue
): Log details if the command does not return 0.(unlabeled)
(of typestring
): Command to run
process.read.lines
Perform a shell call and return the list of its output lines.
Type:
(?timeout : float, ?env : [string * string], ?inherit_env : bool,
?log_errors : bool, string) -> [string]
Arguments:
timeout
(of typefloat
, which defaults to-1.
): Cancel process aftertimeout
has elapsed. Ignored if negative.env
(of type[string * string]
, which defaults to[]
): Process environmentinherit_env
(of typebool
, which defaults totrue
): Inherit calling process’s environment whenenv
parameter is empty.log_errors
(of typebool
, which defaults totrue
): Log details if the command does not return 0.(unlabeled)
(of typestring
): Command to run
process.run
Run a process in a shell environment. Returns the standard output, as well as standard error and status as methods. The status can be “exit” (the status code is set), “killed” or “stopped” (the status code is the signal), or “exception” (the description is set) or “timeout” (the description is the run time).
Type:
(?env : [string * string], ?inherit_env : bool, ?rwdirs : [string],
?rodirs : [string], ?network : bool?, ?timeout : float?, string) -> unit
Arguments:
env
(of type[string * string]
, which defaults to[]
): Process environmentinherit_env
(of typebool
, which defaults totrue
): Inherit calling process’s environment whenenv
parameter is empty.rwdirs
(of type[string]
, which defaults to["default"]
): Read/write directories for sandboxing."default"
expands to sandbox default.rodirs
(of type[string]
, which defaults to["default"]
): Read-only directories for sandboxing"default"
expands to sandbox default.network
(of typebool?
, which defaults tonull
): Enable or disable network inside sandboxed environment (sandbox default if not specified).timeout
(of typefloat?
, which defaults tonull
): Cancel process aftertimeout
has elapsed. Ignored if negative.(unlabeled)
(of typestring
): Command to run
Methods:
status
(of typestring.{code : int, description : string}
): Status when process ended, can be one of"exit"
(the program exited, thestatus
code is then relevant),"killed"
(the program was killed by signal given instatus
code),"stopped"
(the program was stopped by signal given instatus
code) or"exception"
(the program raised and exception detailed in thedescription
).stderr
(of typestring
): Messages written by process on standard error stream.stdout
(of typestring
): Messages written by process on standard output stream.
process.stderr
The process’ stderr
Type:
socket
.{
close : () -> unit,
non_blocking : (bool) -> unit,
read : ((?timeout : float?) -> string)
.{wait : (?timeout : float?, (() -> unit)) -> unit
},
type : string,
write : ((?timeout : float?, string) -> unit)
.{wait : (?timeout : float?, (() -> unit)) -> unit
}
}
process.stdin
The process’ stdin
Type:
socket
.{
close : () -> unit,
non_blocking : (bool) -> unit,
read : ((?timeout : float?) -> string)
.{wait : (?timeout : float?, (() -> unit)) -> unit
},
type : string,
write : ((?timeout : float?, string) -> unit)
.{wait : (?timeout : float?, (() -> unit)) -> unit
}
}
process.stdout
The process’ stdout
Type:
socket
.{
close : () -> unit,
non_blocking : (bool) -> unit,
read : ((?timeout : float?) -> string)
.{wait : (?timeout : float?, (() -> unit)) -> unit
},
type : string,
write : ((?timeout : float?, string) -> unit)
.{wait : (?timeout : float?, (() -> unit)) -> unit
}
}
process.test
Return true if process exited with 0 code.
Type:
(?timeout : float, ?env : [string * string], ?inherit_env : bool, string) ->
bool
Arguments:
timeout
(of typefloat
, which defaults to-1.
): Cancel process aftertimeout
has elapsed. Ignored if negative.env
(of type[string * string]
, which defaults to[]
): Process environmentinherit_env
(of typebool
, which defaults totrue
): Inherit calling process’s environment whenenv
parameter is empty.(unlabeled)
(of typestring
): Command to test
process.time
Get the execution time of the current liquidsoap process.
Type:
() -> unit
Methods:
system
(of typefloat
)user
(of typefloat
)
read
Read some value from standard input (console).
Type:
(?hide : bool) -> string
Arguments:
hide
(of typebool
, which defaults tofalse
): Hide typed characters (for passwords).
reopen.stderr
Reopen standard error on the given file
Type:
(string) -> unit
Arguments:
(unlabeled)
(of typestring
)
reopen.stdin
Reopen standard input on the given file
Type:
(string) -> unit
Arguments:
(unlabeled)
(of typestring
)
reopen.stdout
Reopen standard output on the given file
Type:
(string) -> unit
Arguments:
(unlabeled)
(of typestring
)
restart
Restart the application.
Type:
() -> unit
runtime.gc.get
Return the current values of the GC parameters
Type:
() -> unit
Methods:
allocation_policy
(of typeint
)custom_major_ratio
(of typeint
)custom_minor_max_size
(of typeint
)custom_minor_ratio
(of typeint
)major_heap_increment
(of typeint
)max_overhead
(of typeint
)minor_heap_size
(of typeint
)space_overhead
(of typeint
)stack_limit
(of typeint
)verbose
(of typeint
)window_size
(of typeint
)
runtime.gc.print_stat
Print the current values of the memory management counters in human-readable form.
Type:
() -> unit
runtime.gc.quick_stat
Same as stat except that live_words
,
live_blocks
, free_words
,
free_blocks
, largest_free
, and
fragments
are set to 0
. This function is much
faster than gc.stat
because it does not need to go through
the heap.
Type:
() -> unit
Methods:
compactions
(of typeint
)fragments
(of typeint
)free_blocks
(of typeint
)free_words
(of typeint
)heap_chunks
(of typeint
)heap_words
(of typeint
)largest_free
(of typeint
)live_blocks
(of typeint
)live_words
(of typeint
)major_collections
(of typeint
)major_words
(of typefloat
)minor_collections
(of typeint
)minor_words
(of typefloat
)promoted_words
(of typefloat
)stack_size
(of typeint
)top_heap_words
(of typeint
)
runtime.gc.set
Set the GC parameters.
Type:
(
{
allocation_policy : int,
custom_major_ratio : int,
custom_minor_max_size : int,
custom_minor_ratio : int,
major_heap_increment : int,
max_overhead : int,
minor_heap_size : int,
space_overhead : int,
stack_limit : int,
verbose : int,
window_size : int
}) -> unit
Arguments:
(unlabeled)
(of type{ allocation_policy : int, custom_major_ratio : int, custom_minor_max_size : int, custom_minor_ratio : int, major_heap_increment : int, max_overhead : int, minor_heap_size : int, space_overhead : int, stack_limit : int, verbose : int, window_size : int }
)
runtime.gc.stat
Return the current values of the memory management counters. This function examines every heap block to get the statistics.
Type:
() -> unit
Methods:
compactions
(of typeint
)fragments
(of typeint
)free_blocks
(of typeint
)free_words
(of typeint
)heap_chunks
(of typeint
)heap_words
(of typeint
)largest_free
(of typeint
)live_blocks
(of typeint
)live_words
(of typeint
)major_collections
(of typeint
)major_words
(of typefloat
)minor_collections
(of typeint
)minor_words
(of typefloat
)promoted_words
(of typefloat
)stack_size
(of typeint
)top_heap_words
(of typeint
)
runtime.jemalloc.epoch
Refresh the epoch counter for statistics
Type:
() -> unit
runtime.jemalloc.mallctl.bool
Get an option of type bool using mallctl. Returned value has the same type as a reference.
Type:
(string) -> () -> bool
Arguments:
(unlabeled)
(of typestring
): Option name
Methods:
set
(of type(bool) -> unit
): Set option value
runtime.jemalloc.mallctl.flag
Set an option flag
Type:
(string) -> unit
Arguments:
(unlabeled)
(of typestring
): Flag name
runtime.jemalloc.mallctl.int
Get an option of type int using mallctl. Returned value has the same type as a reference.
Type:
(string) -> () -> int
Arguments:
(unlabeled)
(of typestring
): Option name
Methods:
set
(of type(int) -> unit
): Set option value
runtime.jemalloc.mallctl.string
Get an option of type string using mallctl. Returned value has the same type as a reference.
Type:
(string) -> () -> string
Arguments:
(unlabeled)
(of typestring
): Option name
Methods:
set
(of type(string) -> unit
): Set option value
runtime.jemalloc.memory_stats
Return memory allocation stats from jemalloc
.
Type:
() -> unit
Methods:
active
(of typeint
)allocated
(of typeint
)mapped
(of typeint
)resident
(of typeint
)
runtime.jemalloc.version
Jemalloc version information
Type:
() -> string
Methods:
git_version
(of typestring
): Git versionmajor
(of typeint
): Major versionminor
(of typeint
): Minor version
runtime.locale.set
Set the system’s locale. This sets LANG
and
LC_ALL
environment variables to the given value and then
calls setlocale
. This is set to "C"
on
startup, which defaults to the system’s default locale. Keep in mind
that changing this can potentially impact some functions such a
float_of_string
.
Type:
(string) -> unit
Arguments:
(unlabeled)
(of typestring
)
runtime.sys.word_size
Size of one word on the machine currently executing the program, in
bits. Either 32
or 64
.
Type:
int
shutdown
Shutdown the application.
Type:
(?code : int) -> unit
Arguments:
code
(of typeint
, which defaults to0
): Exit code. Default:0
source.is_up
Check whether a source is up.
Type:
(source('a)) -> bool
Arguments:
(unlabeled)
(of typesource('a)
)
Time
time
Return the current time since 00:00:00 GMT, Jan. 1, 1970, in seconds.
Type:
() -> float
time.local
Convert a time in seconds into a date in the local time zone (current time is used if no argument is provided).
Type:
(?float?) -> unit
Arguments:
(unlabeled)
(of typefloat?
, which defaults tonull
)
Methods:
day
(of typeint
): Day of month.dst
(of typebool
): Daylight time savings in effect.hour
(of typeint
): Hours.min
(of typeint
): Minutes.month
(of typeint
): Month of year.sec
(of typeint
): Seconds.week_day
(of typeint
): Day of week (Sunday is 0 or 7, Saturday is 6).year
(of typeint
): Year.year_day
(of typeint
): Day of year, between1
and366
.
time.make
Convert a date and time in the local timezone into a time, in seconds, since 00:00:00 GMT, Jan. 1, 1970.
Type:
(
{
day : int,
dst : bool?,
hour : int,
min : int,
month : int,
sec : int,
year : int
}) -> float
Arguments:
(unlabeled)
(of type{ day : int, dst : bool?, hour : int, min : int, month : int, sec : int, year : int }
)
time.predicate
Parse a string as a time predicate
Type:
(string) -> () -> bool
Arguments:
(unlabeled)
(of typestring
)
time.string
Obtain a string representation of the current time. It takes a string as argument where special strings are replaced roughly following strftime: %H is replaced by the current hour, %M minute, %S second, %A week day (%a week day abbreviated), %d month day, %B month name (%b month name abbreviated), %z timezone.
Type:
(?time : float?, ?string?) -> string
Example:
s = time.string("Current time is %H:%M.")
print(s)
Example:
# Backup a source naming the file based on time
output.file({time.string("/path/to/file%H%M%S.wav")}, ...)
Arguments:
time
(of typefloat?
, which defaults tonull
): If specified convert the given time (in seconds since 00:00:00 GMT, Jan. 1, 1970) instead of the current time.(unlabeled)
(of typestring?
, which defaults tonull
): Description of the string to produce, e.g."Current time is %H:%M
“`.
time.up
Current time, in seconds, since the script has started.
Type:
() -> float
time.utc
Convert a time in seconds into a date in the UTC time zone (current time is used if no argument is provided).
Type:
(?float?) -> unit
Arguments:
(unlabeled)
(of typefloat?
, which defaults tonull
)
Methods:
day
(of typeint
): Day of month.dst
(of typebool
): Daylight time savings in effect.hour
(of typeint
): Hours.min
(of typeint
): Minutes.month
(of typeint
): Month of year.sec
(of typeint
): Seconds.week_day
(of typeint
): Day of week (Sunday is 0 or 7, Saturday is 6).year
(of typeint
): Year.year_day
(of typeint
): Day of year, between1
and366
.
time.zone
Returns a description of the time zone set for the running process.
Type:
() -> string
Methods:
daylight
(of typestring
): Daylight Savings Timeutc_diff
(of typeint
): Difference in seconds between the current timezone and UTC.
time.zone.set
Set the current time zone. This is equivalent to setting the
TZ
environment variable.
Type:
(string) -> unit
Arguments:
(unlabeled)
(of typestring
)
Track / Audio processing
track.audio.add
Mix audio tracks with optional normalization.
Type:
(?id : string?, [pcm('a).{weight? : {float}}], ?normalize : {bool},
?power : {bool}) -> pcm('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.(unlabeled)
(of type[pcm('a).{weight? : {float}}]
)normalize
(of type{bool}
, which defaults totrue
): Divide by the sum of weights of ready sources (or by the number of ready sources if weights are not specified).power
(of type{bool}
, which defaults tofalse
): Perform constant-power normalization.
track.audio.amplify
Multiply the amplitude of the signal.
Type:
(?id : string?, {float}, ?override : string?, pcm('a)) -> pcm('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.(unlabeled)
(of type{float}
): Multiplicative factor.override
(of typestring?
, which defaults to"liq_amplify"
): Specify the name of a metadata field that, when present and well-formed, overrides the amplification factor for the current track. Well-formed values are floats in decimal notation (e.g.0.7
) which are taken as normal/linear multiplicative factors; values can be passed in decibels with the suffixdB
(e.g.-8.2 dB
, but the spaces do not matter).(unlabeled)
(of typepcm('a)
)
track.audio.clip
Clip samples, i.e. ensure that all values are between -1 and 1:
values lower than -1 become -1 and values higher than 1 become 1.
nan
values become 0.
Type:
(?id : string?, pcm('a)) -> pcm('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.(unlabeled)
(of typepcm('a)
)
track.audio.comb
Comb filter.
Type:
(?id : string?, ?delay : float, ?feedback : {float}, pcm('a)) -> pcm('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.delay
(of typefloat
, which defaults to0.001
): Delay in seconds.feedback
(of type{float}
, which defaults to-6.
): Feedback coefficient in dB.(unlabeled)
(of typepcm('a)
)
track.audio.compand
Compand the signal.
Type:
(?id : string?, ?mu : float, source(pcm('a))) -> pcm('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.mu
(of typefloat
, which defaults to1.
)(unlabeled)
(of typesource(pcm('a))
)
track.audio.compress
Compress the signal.
Type:
(?id : string?, ?attack : {float}, ?release : {float}, ?lookahead : {float},
?threshold : {float}, ?track_sensitive : bool, ?knee : {float},
?pre_gain : {float}, ?gain : {float}, ?ratio : {float}, ?window : {float},
?wet : {float}, pcm('a)) -> pcm('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.attack
(of type{float}
, which defaults to50.
): Attack time (ms).release
(of type{float}
, which defaults to400.
): Release time (ms).lookahead
(of type{float}
, which defaults to0.
): Lookahead (ms).threshold
(of type{float}
, which defaults to-10.
): Threshold level (dB).track_sensitive
(of typebool
, which defaults tofalse
): Reset on every track.knee
(of type{float}
, which defaults to1.
): Knee width (dB).pre_gain
(of type{float}
, which defaults to0.
): Pre-amplification (dB).gain
(of type{float}
, which defaults to0.
): Post-amplification (dB).ratio
(of type{float}
, which defaults to2.
): Gain reduction ratio (reduction is ratio:1). Must be at least 1.window
(of type{float}
, which defaults to0.
): RMS window length (second).0.
means peak mode.wet
(of type{float}
, which defaults to1.
): How much of input sound to output (between 0 and 1, 0 means only original sound, 1 means only compressed sound).(unlabeled)
(of typepcm('a)
)
Methods:
gain
(of type() -> float
): Gain (dB).rms
(of type() -> float
): RMS or peak power (linear).
track.audio.compress.exponential
Exponential compressor.
Type:
(?id : string?, ?mu : float, pcm('a)) -> pcm('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.mu
(of typefloat
, which defaults to2.
): Exponential compression factor, typically greater than 1.(unlabeled)
(of typepcm('a)
)
track.audio.map
Map a function to all audio samples. This is SLOW!
Type:
(?id : string?, ((float) -> float), pcm('a)) -> pcm('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.(unlabeled)
(of type(float) -> float
)(unlabeled)
(of typepcm('a)
)
This function is experimental.
track.audio.stereo.ms.decode
Decode mid+side stereo (M/S) to left+right stereo.
Type:
(?id : string?, ?width : float, pcm(stereo)) -> pcm(stereo)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.width
(of typefloat
, which defaults to1.
): Width of the stereo field.(unlabeled)
(of typepcm(stereo)
)
track.audio.stereo.ms.encode
Encode left+right stereo to mid+side stereo (M/S).
Type:
(?id : string?, pcm(stereo)) -> pcm(stereo)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.(unlabeled)
(of typepcm(stereo)
)
track.audio.stereo.pan
Pan a stereo sound.
Type:
(?id : string?, ?pan : {float}, ?field : {float}, pcm(stereo)) -> pcm(stereo)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.pan
(of type{float}
, which defaults to0.
): Pan ranges between -1 and 1.field
(of type{float}
, which defaults to90.
): Field width in degrees (between 0 and 90).(unlabeled)
(of typepcm(stereo)
)
track.audio.stereo.width
Spacializer which allows controlling the width of the signal.
Type:
(?id : string?, ?{float}, pcm(stereo)) -> pcm(stereo)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.(unlabeled)
(of type{float}
, which defaults to0.
): Width of the signal (-1: mono, 0.: original, 1.: wide stereo).(unlabeled)
(of typepcm(stereo)
)
track.audio.stereotool
Process the given audio track with StereoTool.
Type:
(?id : string?, library_file : string, ?license_key : string?,
?preset : string?, ?load_type : string, pcm('a)) -> pcm('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.library_file
(of typestring
): Path to the shared library file.license_key
(of typestring?
, which defaults tonull
)preset
(of typestring?
, which defaults tonull
): Path to a preset file to load when initializing the operator.load_type
(of typestring
, which defaults to"totalinit"
): Load type for preset. One of: “totalinit”, “all_settings”, “audiofm”, “audio”, “processing”, “repair”, “repair_no_pnr” or “sublevel_pnr”.(unlabeled)
(of typepcm('a)
)
Methods:
api_version
(of type() -> int
): API version.latency
(of type() -> float
): Get the operator’s latency.software_version
(of type() -> int
): Software version.unlincensed_used_features
(of type() -> string?
): Check if the license is valid for the current settings.valid_license
(of type() -> bool
): Check if the license is valid for the current settings.
track.audio.stretch
Slow down or accelerate an audio stream by stretching (sounds lower) or squeezing it (sounds higher).
Type:
(?id : string?, ratio : {float}, pcm('a)) -> pcm('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.ratio
(of type{float}
): A value higher than 1 means slowing down.(unlabeled)
(of typepcm('a)
)
track.decode.audio.pcm_f32
Decode an audio track using PCM signed 16 bit integers.
Type:
(?id : string?, pcm_f32('a)) -> pcm('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.(unlabeled)
(of typepcm_f32('a)
)
track.decode.audio.pcm_s16
Decode an audio track using PCM signed 16 bit integers.
Type:
(?id : string?, pcm_s16('a)) -> pcm('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.(unlabeled)
(of typepcm_s16('a)
)
track.encode.audio.pcm_f32
Encode an audio track using PCM signed 16 bit integers.
Type:
(?id : string?, pcm('a)) -> pcm_f32('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.(unlabeled)
(of typepcm('a)
)
track.encode.audio.pcm_s16
Encode an audio track using PCM signed 16 bit integers.
Type:
(?id : string?, pcm('a)) -> pcm_s16('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.(unlabeled)
(of typepcm('a)
)
Track / Conversion
track.audio.mean
Produce mono audio by taking the mean of all audio channels.
Type:
(?id : string?, ?normalize : bool, pcm('a)) -> pcm(mono)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.normalize
(of typebool
, which defaults totrue
): Divide the output volume by the number of channels.(unlabeled)
(of typepcm('a)
): Track whose mean should be computed.
track.audio.stereo
Convert any pcm audio track into a stereo track.
Type:
(?id : string?, pcm('a)) -> pcm(stereo)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.(unlabeled)
(of typepcm('a)
)
track.audio.swap
Swap two channels of a stereo track.
Type:
(?id : string?, pcm(stereo)) -> pcm(stereo)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.(unlabeled)
(of typepcm(stereo)
)
track.ffmpeg.decode.audio
Decode a track content
Type:
(?id : string?, ffmpeg.copy('a)) -> pcm('b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.(unlabeled)
(of typeffmpeg.copy('a)
)
track.ffmpeg.decode.video
Decode a track content
Type:
(?id : string?, ffmpeg.copy('a)) -> canvas('b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.(unlabeled)
(of typeffmpeg.copy('a)
)
track.ffmpeg.encode.audio
Convert a track’s content
Type:
(?id : string?, format(audio=pcm('a), 'b), pcm('a)) -> ffmpeg.copy('c)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.(unlabeled)
(of typeformat(audio=pcm('a), 'b)
): Encoding format.(unlabeled)
(of typepcm('a)
)
track.ffmpeg.encode.video
Convert a track’s content
Type:
(?id : string?, format(video=canvas('a), 'b), canvas('a)) -> ffmpeg.copy('c)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.(unlabeled)
(of typeformat(video=canvas('a), 'b)
): Encoding format.(unlabeled)
(of typecanvas('a)
)
track.ffmpeg.raw.decode.audio
Decode a track content
Type:
(?id : string?, ffmpeg.audio.raw('a)) -> pcm('b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.(unlabeled)
(of typeffmpeg.audio.raw('a)
)
track.ffmpeg.raw.decode.video
Decode a track content
Type:
(?id : string?, ffmpeg.video.raw('a)) -> canvas('b)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.(unlabeled)
(of typeffmpeg.video.raw('a)
)
track.ffmpeg.raw.encode.audio
Convert a track’s content
Type:
(?id : string?, format(audio=ffmpeg.audio.raw('a), 'b), pcm('c)) ->
ffmpeg.audio.raw('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.(unlabeled)
(of typeformat(audio=ffmpeg.audio.raw('a), 'b)
): Encoding format.(unlabeled)
(of typepcm('c)
)
track.ffmpeg.raw.encode.video
Convert a track’s content
Type:
(?id : string?, format(video=ffmpeg.video.raw('a), 'b), canvas('c)) ->
ffmpeg.video.raw('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.(unlabeled)
(of typeformat(video=ffmpeg.video.raw('a), 'b)
): Encoding format.(unlabeled)
(of typecanvas('c)
)
Track / FFmpeg filter
ffmpeg.filter.audio.output
Return an audio track from a filter’s output
Type:
(?id : string?, ?pass_metadata : bool, ffmpeg.filter.graph,
ffmpeg.filter.audio) -> ffmpeg.audio.raw('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.pass_metadata
(of typebool
, which defaults totrue
): Pass ffmpeg stream metadata to liquidsoap(unlabeled)
(of typeffmpeg.filter.graph
)(unlabeled)
(of typeffmpeg.filter.audio
)
Track / Track processing
track.audio.defer
Defer an audio track by a given amount of time. Track will be
available when the given delay
has been fully buffered. Use
this operator instead of buffer
when buffering large amount
of data as initial delay.
Type:
(?id : string?, delay : float, ?overhead : float?, pcm_s16('a)) ->
pcm_s16('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.delay
(of typefloat
): Duration of the delay, in seconds.overhead
(of typefloat?
, which defaults tonull
): Duration of the delay overhead, in seconds. Defaults to frame size.(unlabeled)
(of typepcm_s16('a)
): Track to delay.
track.metadata
Return the metadata associated with the given track
Type:
(?id : string?, 'a) -> metadata where 'a is a track
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.(unlabeled)
(of typeanything that is a track
)
track.metadata.map
Rewrite metadata on the fly using a function.
Type:
(?id : string?, (([string * string]) -> [string * string]), ?update : bool,
?strip : bool, ?insert_missing : bool, metadata) -> metadata
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.(unlabeled)
(of type([string * string]) -> [string * string]
): A function that returns new metadata.update
(of typebool
, which defaults totrue
): Update metadata. If false, existing metadata are cleared and only returned values are set as new metadata.strip
(of typebool
, which defaults tofalse
): Completely remove empty metadata. Operates on both empty values and empty metadata chunk.insert_missing
(of typebool
, which defaults totrue
): Treat track beginnings without metadata as having empty ones. The operational order is: create empty if needed, map and strip if enabled.(unlabeled)
(of typemetadata
)
track.metadata.merge
Merge metadata from all given tracks. If two sources have metadata with the same label at the same time, the one from the last source in the list takes precedence.
Type:
(?id : string?, [metadata]) -> metadata
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.(unlabeled)
(of type[metadata]
)
track.track_marks
Return the track marks associated with the given track
Type:
(?id : string?, 'a) -> track_marks where 'a is a track
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.(unlabeled)
(of typeanything that is a track
)
Track / Video processing
ffmpeg.filter.video.output
Return a video track from a filter’s output
Type:
(?id : string?, ?pass_metadata : bool, ffmpeg.filter.graph,
ffmpeg.filter.video) -> ffmpeg.video.raw('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.pass_metadata
(of typebool
, which defaults totrue
): Pass ffmpeg stream metadata to liquidsoap(unlabeled)
(of typeffmpeg.filter.graph
)(unlabeled)
(of typeffmpeg.filter.video
)
track.video.add
Merge video tracks.
Type:
(?id : string?, [canvas('a)]) -> canvas('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.(unlabeled)
(of type[canvas('a)]
)
track.video.add_image
Add a static image on the given video track.
Type:
(?id : string?, ?fallible : bool, ?width : {int}?, ?height : {int}?,
?x : {int}, ?y : {int}, file : {string}, canvas('a)) -> canvas('a)
Arguments:
id
(of typestring?
, which defaults to"track.video.add_image"
): Force the value of the source ID.fallible
(of typebool
, which defaults tofalse
): Whether we are allowed to fail (in case the file is non-existent or invalid).width
(of type{int}?
, which defaults tonull
): Scale to widthheight
(of type{int}?
, which defaults tonull
): Scale to heightx
(of type{int}
, which defaults to0
): x position.y
(of type{int}
, which defaults to0
): y position.file
(of type{string}
): Path to the image file.(unlabeled)
(of typecanvas('a)
)
track.video.tile
Tile video tracks.
Type:
(?id : string?, ?proportional : bool, [canvas('a)]) -> canvas('a)
Arguments:
id
(of typestring?
, which defaults tonull
): Force the value of the track ID.proportional
(of typebool
, which defaults totrue
): Scale preserving the proportions.(unlabeled)
(of type[canvas('a)]
)