Source / Visualization
server.rms
Register a command that outputs the RMS of the returned source.
Type:
(?id : string?, source(audio=pcm('a), 'b)) -> source(audio=pcm('a), 'b)
Arguments:
id(of typestring?, which defaults tonull): Force the value of the source ID.(unlabeled)(of typesource(audio=pcm('a), 'b))
Methods:
buffered(of type() -> [string * float]): Length of buffered data.duration(of type() -> float): Estimation of the duration of the current track.elapsed(of type() -> float): Elapsed time in the current track.fallible(of typebool): Indicate if a source may fail, i.e. may not be ready to stream.id(of type() -> string): Identifier of the source.is_active(of type() -> bool):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.on_metadata(of type((([string * string]) -> unit)) -> unit): Call a given handler on metadata packets.on_shutdown(of type((() -> unit)) -> unit): Register a function to be called when source shuts down.on_track(of type((([string * string]) -> unit)) -> unit): Call a given handler on new tracks.on_wake_up(of type((() -> unit)) -> unit): Register a function to be called after the source is asked to get ready. This is when, for instance, the source's final ID is set.remaining(of type() -> float): Estimation of remaining time in the current track.rms(of type() -> float): Current value for the RMS volume.seek(of type(float) -> float): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync(of type() -> bool): Is the source currently controlling its own real-time loop.skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
video.vumeter
VU meter: display the audio volume (RMS in dB). This adds a video track to the source.
Type:
(?rms_min : float, ?rms_max : float, ?window : float, ?color : int,
?persistence : float, 'b
.{audio : pcm('a), metadata? : metadata, track_marks? : track_marks}) ->
source(audio=pcm('a), video=canvas('c), 'b)
where 'b is a set of tracks to be muxed into a source
Arguments:
rms_min(of typefloat, which defaults to-35.): Minimal volume (dB).rms_max(of typefloat, which defaults to0.): Maximal volume (dB).window(of typefloat, which defaults to0.1): Duration in seconds of volume computation.color(of typeint, which defaults to16711680): Color of the display (0xRRGGBB).persistence(of typefloat, which defaults to0.): Persistence of the display (s).(unlabeled)(of type'b.{audio : pcm('a), metadata? : metadata, track_marks? : track_marks} where 'b is a set of tracks to be muxed into a source)
Methods:
buffered(of type() -> [string * float]): Length of buffered data.duration(of type() -> float): Estimation of the duration of the current track.elapsed(of type() -> float): Elapsed time in the current track.fallible(of typebool): Indicate if a source may fail, i.e. may not be ready to stream.id(of type() -> string): Identifier of the source.is_active(of type() -> bool):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.on_metadata(of type((([string * string]) -> unit)) -> unit): Call a given handler on metadata packets.on_shutdown(of type((() -> unit)) -> unit): Register a function to be called when source shuts down.on_track(of type((([string * string]) -> unit)) -> unit): Call a given handler on new tracks.on_wake_up(of type((() -> unit)) -> unit): Register a function to be called after the source is asked to get ready. This is when, for instance, the source's final ID is set.remaining(of type() -> float): Estimation of remaining time in the current track.seek(of type(float) -> float): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync(of type() -> bool): Is the source currently controlling its own real-time loop.skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
vumeter
VU meter: display the audio volume (RMS in dB) on the standard output.
Type:
(?rms_min : float, ?rms_max : float, ?window : float, ?scroll : bool,
source(audio=pcm('a), 'b)) -> source(audio=pcm('a), 'b)
Arguments:
rms_min(of typefloat, which defaults to-25.): Minimal volume (dB).rms_max(of typefloat, which defaults to-5.): Maximal volume (dB).window(of typefloat, which defaults to0.5): Duration in seconds of volume computation.scroll(of typebool, which defaults tofalse): Update the display in the same line.(unlabeled)(of typesource(audio=pcm('a), 'b))
Methods:
buffered(of type() -> [string * float]): Length of buffered data.duration(of type() -> float): Estimation of the duration of the current track.elapsed(of type() -> float): Elapsed time in the current track.fallible(of typebool): Indicate if a source may fail, i.e. may not be ready to stream.id(of type() -> string): Identifier of the source.is_active(of type() -> bool):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.on_metadata(of type((([string * string]) -> unit)) -> unit): Call a given handler on metadata packets.on_shutdown(of type((() -> unit)) -> unit): Register a function to be called when source shuts down.on_track(of type((([string * string]) -> unit)) -> unit): Call a given handler on new tracks.on_wake_up(of type((() -> unit)) -> unit): Register a function to be called after the source is asked to get ready. This is when, for instance, the source's final ID is set.remaining(of type() -> float): Estimation of remaining time in the current track.rms(of type() -> float): Current value for the RMS volume.seek(of type(float) -> float): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync(of type() -> bool): Is the source currently controlling its own real-time loop.skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.