pipecat.device.clock module

Data sources that retrieve information from clocks.

pipecat.device.clock.metronome(rate=<Quantity(1.0, 'second')>)

Generate an empty record at fixed time intervals using the host clock.

Typically, you would use functions such as pipecat.utility.add_field() or pipecat.utility.add_timestamp() to populate the (otherwise empty) records.

Examples

If you want to know what time it is, at 5-minute intervals:

>>> pipe = pipecat.device.clock.metronome(pipecat.quantity(5, pipecat.units.minutes))
>>> pipe = pipecat.utility.add_timestamp(pipe)
>>> for record in pipe:
...   print record
Parameters:rate (time quantity, required) – The amount of time to wait between records.
Yields:records (dict) – Yields an empty record at fixed time intervals.