Skip to content

Commit

Permalink
Merge pull request #834 from retiutut/development
Browse files Browse the repository at this point in the history
update LSL 3 streams networking test
  • Loading branch information
retiutut authored Jul 20, 2020
2 parents 1c60c3e + 386f524 commit e12a912
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions Networking-Test-Kit/LSL/lslStreamTest_3Streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
from pylsl import StreamInlet, resolve_stream
import time

numStreams = 2
numStreams = 3
# first resolve an EEG stream on the lab network
print("looking for an EEG stream...")
stream1 = resolve_stream('type', 'EEG')
stream2 = resolve_stream('type', 'AUX')
# stream3 = resolve_stream('type', 'FFT')
stream3 = resolve_stream('type', 'FFT')

# create a new inlet to read from the stream
inlet = StreamInlet(stream1[0])
inlet2 = StreamInlet(stream2[0])
#inlet3 = StreamInlet(stream3[0])
inlet3 = StreamInlet(stream3[0])

def testLSLSamplingRates():
print( "Testing Sampling Rates..." )
Expand All @@ -35,20 +35,18 @@ def testLSLSamplingRates():
chunk, timestamps = inlet.pull_chunk()
if timestamps:
numSamples1 += 1
numSamples1 = 0
elif i == 1:
chunk, timestamps2 = inlet2.pull_sample()
chunk, timestamps2 = inlet2.pull_chunk()
if timestamps2:
numSamples2 += 1
numSamples2 = 0
#elif i == 2:
#chunk, timestamps3 = inlet3.pull_sample()
#if timestamps3:
#numSamples3 += 1
elif i == 2:
chunk, timestamps3 = inlet3.pull_chunk()
if timestamps3:
numSamples3 += 1
#print("Stream", i + 1, " == ", chunk)
print( "Stream 1 Sampling Rate == ", numSamples1 / 5 , " | Type : EEG")
print( "Stream 2 Sampling Rate == ", numSamples2 / 5 , " | Type : FFT")
print( "Stream 3 Sampling Rate == ", numSamples3 / 5 , " | Type : AUX")
print( "Stream 1 Sampling Rate == ", numSamples1, " | Type : EEG")
print( "Stream 2 Sampling Rate == ", numSamples2, " | Type : AUX")
print( "Stream 3 Sampling Rate == ", numSamples3, " | Type : FFT")


testLSLSamplingRates()

0 comments on commit e12a912

Please sign in to comment.