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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
amplify
Multiply the amplitude of the signal.
Type:
(?id : string?, ?override : {string?}, {float}, source(audio='a, 'b)) ->
source(audio='a, 'b)
where 'b is a set of tracks to be muxed into a source,
'a is a track and a track of type: pcm, pcm_s16 or pcm_f32
Arguments:
id(of typestring?, which defaults to"amplify"): Force the value of the track ID.override(of type{string?}, which defaults to<fun>): 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). Defaults tosettings.amplify.metadata. Set tonullto disable.(unlabeled)(of type{float}): Multiplicative factor.(unlabeled)(of typesource(audio='a, 'b) where 'b is a set of tracks to be muxed into a source, 'a is a track and a track of type: pcm, pcm_s16 or pcm_f32)
Methods:
buffered(of type() -> [string * float]): Length of buffered data.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string):skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string):skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string):skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string):skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string):skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
autocue.register
Register an autocue implementation.
Type:
(name : string,
((request_metadata : [string * string], file_metadata : [string * string],
string) ->
{
amplify? : string,
cue_in : float,
cue_out : float,
extra_metadata? : [string * string],
fade_in : float,
fade_in_curve? : float,
fade_in_type? : string,
fade_out : float,
fade_out_curve? : float,
fade_out_type? : string,
start_next? : float}?)) -> unit
Arguments:
name(of typestring): Name of the implementation(unlabeled)(of type(request_metadata : [string * string], file_metadata : [string * string], string) -> { amplify? : string, cue_in : float, cue_out : float, extra_metadata? : [string * string], fade_in : float, fade_in_curve? : float, fade_in_type? : string, fade_out : float, fade_out_curve? : float, fade_out_type? : string, start_next? : float}?)
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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string):skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
defer
Defer the source's audio track by a given amount of time. Source 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.
This operator encodes and decodes the audio content. See defer.pcm_s16 for a low-level operator using directly the pcm_s16 format.
Type:
(?id : string?, delay : float, ?overhead : float?, source(audio=pcm('a), 'b)) ->
source(audio=pcm('a))
Arguments:
id(of typestring?, which defaults to"defer"): Force the source's IDdelay(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 typesource(audio=pcm('a), 'b))
Methods:
buffered(of type() -> [string * float]): Length of buffered data.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string):skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
defer.pcm_s16
Defer the source's audio track by a given amount of time. Source 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.
This operator uses a source already using pcm_s16 audio data. It can be used to prevent unneeded data copy. Typically, decoders that know how to decode to pcm_s16 (like ffmpeg) will decode directly into the format and encoders who support it (also %ffmpeg) will encoder directly from the pcm_s16 data. Use defer if you prefer a more user-friendly operator.
Type:
(?id : string?, delay : float, ?overhead : float?, source(audio=pcm_s16('a))) ->
source(audio=pcm_s16('a))
Arguments:
id(of typestring?, which defaults to"defer.pcm_s16"): Force the source's IDdelay(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 typesource(audio=pcm_s16('a)))
Methods:
buffered(of type() -> [string * float]): Length of buffered data.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string):skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.0): 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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.0): 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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
file.autocue.metadata
Return the file's autocue values as metadata suitable for metadata override.
Type:
(request_metadata : [string * string], string) -> [string * string]
Arguments:
request_metadata(of type[string * string])(unlabeled)(of typestring)
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.0)wetness(of type{float}, which defaults to1.0): 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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.0): Q(unlabeled)(of typesource('a))
Methods:
buffered(of type() -> [string * float]): Length of buffered data.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.0): Q(unlabeled)(of typesource('a))
Methods:
buffered(of type() -> [string * float]): Length of buffered data.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.0): Shelf slope (in dB/octave)(unlabeled)(of typesource('a))
Methods:
buffered(of type() -> [string * float]): Length of buffered data.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.0): Q(unlabeled)(of typesource('a))
Methods:
buffered(of type() -> [string * float]): Length of buffered data.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.0): Shelf slope (dB/octave)(unlabeled)(of typesource('a))
Methods:
buffered(of type() -> [string * float]): Length of buffered data.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.0): Q(unlabeled)(of typesource('a))
Methods:
buffered(of type() -> [string * float]): Length of buffered data.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.0): Gain (in dB)q(of type{float}, which defaults to1.0): Q(unlabeled)(of typesource('a))
Methods:
buffered(of type() -> [string * float]): Length of buffered data.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.0): Quality factor(unlabeled)(of typesource(audio=pcm('a), 'b))
Methods:
buffered(of type() -> [string * float]): Length of buffered data.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.0): Quality factor(unlabeled)(of typesource(audio=pcm('a), 'b))
Methods:
buffered(of type() -> [string * float]): Length of buffered data.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.0): Quality factor(unlabeled)(of typesource(audio=pcm('a), 'b))
Methods:
buffered(of type() -> [string * float]): Length of buffered data.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.0): 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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.0): Feedback coefficient in dB.freq(of type{float}, which defaults to0.5): Frequency in Hz.phase(of type{float}, which defaults to1.0): Phase difference between channels in radians.(unlabeled)(of typesource(audio=pcm('a), 'b))
Methods:
buffered(of type() -> [string * float]): Length of buffered data.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.0): Time to fully open the gate (ms).hold(of type{float}, which defaults to1000.0): Minimum amount of time the gate stays open (ms).range(of type{float}, which defaults to-30.0): Difference between closed and open level (dB).release(of type{float}, which defaults to2000.0): Time to fully close the gate (ms).threshold(of type{float}, which defaults to-30.0): Threshold at which the gate will open (dB).window(of type{float}, which defaults to1.0): Duration for computing peak (ms).(unlabeled)(of typesource(audio=pcm('a), 'b))
Methods:
buffered(of type() -> [string * float]): Length of buffered data.clock(of typeclock): The source's clockduration(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).generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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,
?enabled : {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.0): Desired RMS (dB).up(of type{float}, which defaults to10.0): 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.0): Minimal gain value (dB).gain_max(of typefloat, which defaults to12.0): 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.0): 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.0): Minimal RMS for activaing gain control (dB).track_sensitive(of typebool, which defaults totrue)enabled(of type{bool}, which defaults totrue): Whether normalization is enabled or not.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.clock(of typeclock): The source's clockduration(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).generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string):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.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.0): Maximal gain value (dB).gain_min(of type{float}, which defaults to-6.0): 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.0): Desired RMS (dB).threshold(of type{float}, which defaults to-40.0): 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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
normalize_track_gain
Amplify source tracks according to track gain normalization metadata. This operator does not compute that value. You can use integrated LUFS track gain or ReplayGain to compute it.
Type:
(?id : string?, source(audio='a, 'b)) -> source(audio='a, 'b)
where 'b is a set of tracks to be muxed into a source,
'a is a track and a track of type: pcm, pcm_s16 or pcm_f32
Arguments:
id(of typestring?, which defaults tonull): Force the value of the source ID.(unlabeled)(of typesource(audio='a, 'b) where 'b is a set of tracks to be muxed into a source, 'a is a track and a track of type: pcm, pcm_s16 or pcm_f32): Source to be amplified.
Methods:
buffered(of type() -> [string * float]): Length of buffered data.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string):skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.peak(of type() -> float): Current value for the peak volume.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.peak(of type() -> float * float): Current value for the peak volume.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.0): 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.0): 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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.0): 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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.0)rate(of type{float}, which defaults to1.0)tempo(of type{float}, which defaults to1.0)(unlabeled)(of typesource(audio=pcm('a), 'b))
Methods:
buffered(of type() -> [string * float]): Length of buffered data.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.clock(of typeclock): The source's clockduration(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).generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.peak(of type() -> float): Peak sample.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset(of type() -> unit): Reset ReplayGain computation.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.0): 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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string):skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string):skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
stereo.pan
Pan a stereo sound.
Type:
(?id : string?, ?field : {float}, {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.field(of type{float}, which defaults to90.0): Field width in degrees (between 0 and 90).(unlabeled)(of type{float}): Pan value. Should be between-1(left side) and1(right side).(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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string):skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.0): 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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string):skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
stereotool
Process an audio source using stereotool
Type:
(?id : string?, library_file : string, ?license_key : string?,
?preset : string?, ?load_type : string, ?active : bool,
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".active(of typebool, which defaults tofalse): Set totrueto keep the source streaming even when not actively used by an output.(unlabeled)(of typesource(audio=pcm('a), 'b))
Methods:
api_version(of type() -> int): API version.buffered(of type() -> [string * float]): Length of buffered data.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string):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.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
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.clock(of typeclock): The source's clockduration(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.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor 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 istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.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, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.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.self_sync_description(of type() -> string):skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready