Start streaming data, this methods stores data in ringbuffer :param num_samples: size of ring buffer to keep data :type num_samples: int :param streamer_params parameter to stream data from brainflow, supported vals: "file://%file_name%:w", "file://%file_name%:a", "streaming
(self, num_samples: int = 1800 * 250, streamer_params: str = None)
| 1303 | raise BrainFlowError('unable to delete streamer', res) |
| 1304 | |
| 1305 | def start_stream(self, num_samples: int = 1800 * 250, streamer_params: str = None) -> None: |
| 1306 | """Start streaming data, this methods stores data in ringbuffer |
| 1307 | |
| 1308 | :param num_samples: size of ring buffer to keep data |
| 1309 | :type num_samples: int |
| 1310 | :param streamer_params parameter to stream data from brainflow, supported vals: "file://%file_name%:w", "file://%file_name%:a", "streaming_board://%multicast_group_ip%:%port%". Range for multicast addresses is from "224.0.0.0" to "239.255.255.255" |
| 1311 | :type streamer_params: str |
| 1312 | """ |
| 1313 | |
| 1314 | if streamer_params is None: |
| 1315 | streamer = None |
| 1316 | else: |
| 1317 | try: |
| 1318 | streamer = streamer_params.encode() |
| 1319 | except BaseException: |
| 1320 | streamer = streamer_params |
| 1321 | |
| 1322 | res = BoardControllerDLL.get_instance().start_stream(num_samples, streamer, self.board_id, self.input_json) |
| 1323 | if res != BrainFlowExitCodes.STATUS_OK.value: |
| 1324 | raise BrainFlowError('unable to start streaming session', res) |
| 1325 | |
| 1326 | def stop_stream(self) -> None: |
| 1327 | """Stop streaming data""" |