forked from labstreaminglayer/liblsl-Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSendStringMarkers.java
More file actions
25 lines (21 loc) · 896 Bytes
/
SendStringMarkers.java
File metadata and controls
25 lines (21 loc) · 896 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package examples;
import edu.ucsd.sccn.LSL;
import java.io.IOException;
public class SendStringMarkers {
public static void main(String[] args) throws IOException, InterruptedException {
System.out.println("Creating a new StreamInfo...");
LSL.StreamInfo info = new LSL.StreamInfo("MyMarkers","Markers",1,LSL.IRREGULAR_RATE,LSL.ChannelFormat.string,"myuid4563");
System.out.println("Creating an outlet...");
LSL.StreamOutlet outlet = new LSL.StreamOutlet(info);
System.out.println("Sending data...");
String[] strings = {"Test 1-2-3","Blah","ABC"};
String[] sample = new String[1];
for (int t=0;t<100000;t++) {
sample[0] = strings[t%3];
outlet.push_sample(sample);
Thread.sleep((long)(Math.random()*2000));
}
outlet.close();
info.destroy();
}
}