Skip to main content

DiagnosticRecorder Node

Passes audio through unchanged while keeping the most recent sampleSeconds of it in memory, so it can be written to a WAV file with the dump action. A change of the input sample rate or channel count discards the audio recorded so far.


Configuration​

sampleSeconds​

Type: Int

Default: 30
Minimum: 1

Length of the rolling recording in seconds. The node keeps this much of the most recent audio in memory so it can be dumped on demand.


Properties​

Inherits properties from its parents, Node, SwitchboardObject.

currentFrames (Read only)​

Type: Int

Total number of audio frames recorded since this node was created, not counting frames that arrived while a dump was being written. Divide by the input sample rate to get elapsed seconds, e.g. to line up external log events with positions in the dumped recording.


Actions​

Inherits actions from its parent, SwitchboardObject.

dump​

Writes the recorded audio (up to the last sampleSeconds seconds) to a WAV file and returns its path. Recording pauses while the file is written. Fails if a dump is already in progress, if nothing has been recorded yet, or if the file cannot be written.

Parameters​

NameTypeDescription
filePath (Optional)StringOutput file path without extension; _recording.wav is appended. If omitted or empty, /tmp/<objectID> is used.

Return Value​

String — Path of the written WAV file, <filePath>_recording.wav.


Events​

This object does not provide any events.