def stream(address, sources): muselsl.stream( address, backend=BACKEND, ppg_enabled="PPG" in sources, acc_enabled="ACC" in sources, gyro_enabled="GYRO" in sources, )
""" Starting a Stream This example shows how to search for available Muses and create a new stream """ from muselsl import stream, list_muses if __name__ == "__main__": muses = list_muses() stream('00:55:da:b3:d8:4c') if not muses: print('No Muses found') else: print("found muse ", muses[0]['address']) stream(muses[0]['address']) # Note: Streaming is synchronous, so code here will not execute until the stream has been closed print('Stream has ended')
from muselsl import stream, list_muses muses = list_muses() #Discover available muse devices via bluetooth if not muses: #If none found print('No Muses found') #Print message to user else: try: stream(muses[0]['address']) #Begin streaming data for first device found except KeyboardInterrupt: #If user exits print('Stream has ended') #Print message then terminate
def _stream(address): stream(address, ppg_enabled=True, acc_enabled=True, gyro_enabled=True) # Note: Streaming is synchronous, so code here will not execute until after the stream has been closed print("Stream has ended")
""" OPEN AND CONNECT TO STREAM """ # open stream with Muse print ('Connecting to Muse Headband...') muses = list_muses() if not muses: print ('No Muses found') else: stream(muses[0]['adress_here']) streams = resolve_byprop('type', 'EEG', timeout = 2) # set stream to inlet, correct time inlet = StreamInlet(streams[0], max_chunklen=12) eeg_time_correction = inlet.time_correction() # get stream info and description stream_info = inlet.info() stream_desc = inlet.desc() # get sampling frequency freq = int(stream_info.nominal_srate()) """ INITIALIZE PARAMETERS """