Class: DataRecorder

DataRecorder

Record input frames from a graph. This sink can handle signal, vector or scalar inputs.

When the recording is stopped (either by calling stop on the node or when the stream is finalized), the callback given as parameter is executed with the recorder data as argument.

Constructor

new DataRecorder(options)

Parameters:
Name Type Description
options Object

Override default parameters.

Properties
Name Type Attributes Default Description
separateArrays Boolean <optional>
false

Format of the retrieved values:

  • when false, format is [{ time, data }, { time, data }, ...]
  • when true, format is { time: [...], data: [...] }
callback function <optional>

Callback to execute when a new record is ended. This can happen when:

  • stop is called on the recorder
  • stop is called on the source.
Source:
To Do:
  • - Add auto record param.
Example
import * as lfo from 'waves-lfo/common';

const eventIn = new lfo.source.EventIn({
 frameType: 'vector',
 frameSize: 2,
 frameRate: 0,
});

const recorder = new lfo.sink.DataRecorder({
  callback: (data) => console.log(data),
});

eventIn.connect(recorder);
eventIn.start();
recorder.start();

eventIn.process(0, [0, 1]);
eventIn.process(1, [1, 2]);

recorder.stop();
> [{ time: 0, data: [0, 1] }, { time: 1, data: [1, 2] }];

Methods

start()

Start recording.

Source:
See:
  • module:client.sink.DataRecorder#stop

stop()

Stop recording and execute the callback defined in parameters.

Source:
See:
  • module:client.sink.DataRecorder#start