def _send_output(self, output, timestamp, name):
"""Send pipeline outputs through the LSL or OSC stream.
NOT PER CHANNEL
Args:
output (scalar): output of the pipeline
timestamp (float): timestamp
"""
for out in self._output_threads:
if isinstance(out, str): # LSL outlet
raise NotImplementedError
# self._outlet.push_sample([output], timestamp=timestamp)
else: # OSC output stream
if USE_LIBLO:
if (np.array(output).size==1):
new_output = [('f', np.asscalar(output))]
message = Message('/{}'.format(name), *new_output)
else:
new_output = [('f', x) for x in output[:]]
message = Message('/{}'.format(name), *new_output)
# send(out, Bundle(timestamp, message))
send(out, message)
else:
raise NotImplementedError
# self._client.send_message(}{}'.format(name),output[:])
if self.verbose:
print('Output: {}'.format(output))
评论列表
文章目录