Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Runtime/Scripts/BaseInlet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ public virtual void AStreamIsFound(StreamInfo stream_info)
Debug.Log(string.Format("LSL Stream {0} found for {1}", stream_info.name(), name));

inlet = new StreamInlet(stream_info);
int buf_samples = (int)Mathf.Ceil((float)(inlet.info().nominal_srate() * maxChunkDuration));
double samplingRate = inlet.info().nominal_srate();
if (samplingRate == LSL.LSL.IRREGULAR_RATE) {
// Irregular rates are usually used for markers. This sampling rate will allow init of buffers that should largely cover normal use cases.
samplingRate = 128;
}
int buf_samples = (int)Mathf.Ceil((float)(samplingRate * maxChunkDuration));
int nChannels = inlet.info().channel_count();

timestamp_buffer = new double[buf_samples];
Expand Down