createOutlet static method

Future<LSLOutlet> createOutlet({
  1. required LSLStreamInfo streamInfo,
  2. int chunkSize = 1,
  3. int maxBuffer = 360,
  4. bool useIsolates = true,
})

Creates a new outlet object.

chunkSize determines how to hand off samples to the buffer, 0 creates a chunk for each push.

maxBuffer determines the size of the buffer that stores incoming samples. NOTE: This is in seconds, if the stream has a sample rate, otherwise it is in 100s of samples (maxBuffer * 10^2). High values will use more memory, low values may lose samples, this should be set as close as possible to the rate of consumption. useIsolates determines whether to use isolates for thread safety. If true, the outlet will use isolates to ensure thread safety. Important: If you do not use isolates, you must ensure that you deal with the consequences of blocking operations which will block the main dart isolate.

Implementation

static Future<LSLOutlet> createOutlet({
  required LSLStreamInfo streamInfo,
  int chunkSize = 1,
  int maxBuffer = 360,
  bool useIsolates = true,
}) async {
  final streamOutlet = LSLOutlet(
    streamInfo,
    chunkSize: chunkSize,
    maxBuffer: maxBuffer,
    useIsolates: useIsolates,
  );
  await streamOutlet.create();

  return streamOutlet;
}