Device Nodes

Audio

class pyacq.devices.PyAudio(**kargs)[source]

Simple wrapper around PyAudio for input and output to audio devices.

check_input_specs()[source]

This method is called during Node.initialize() and may be reimplemented by subclasses to ensure that inputs are correctly configured before the node is started.

In case of misconfiguration, this method must raise an exception.

check_output_specs()[source]

This method is called during Node.initialize() and may be reimplemented by subclasses to ensure that outputs are correctly configured before the node is started.

In case of misconfiguration, this method must raise an exception.

configure(*args, **kwargs)[source]
Parameters:
nb_channel : int

Number of audio channels

sample_rate: float

Sample rate. This value is rounded to integer.

input_device_index : int or None

Input device index (see list_device_specs() and pyaudio documentation). If None then no recording will be requested from the device, and the node will have no output.

output_device_index: in or None

Output device index (see list_device_specs() and pyaudio documentation). If None then no playback will be requested from the device, and the node will have no input.

format : str in (‘int16’, ‘int32’ or ‘float32’)

Internal data format for pyaudio.

chunksize : int (1024 by default)

Size of each chunk. Smaller chunks result in lower overall latency, but may also cause buffering issues (cracks/pops in sound).

default_input_device()[source]

Return the index of the default input device.

default_output_device()[source]

Return the index of the default output device.

Cameras

class pyacq.devices.WebCamAV(**kargs)[source]

Simple webcam device using the av python module, which is a wrapper around ffmpeg or libav.

See http://mikeboers.github.io/PyAV/index.html.

class pyacq.devices.WebCamImageIO(**kargs)[source]

Simple webcam device using the imageio python module.

EEG

class pyacq.devices.brainampsocket.BrainAmpSocket(**kargs)[source]

BrainAmp EEG amplifier from Brain Products http://www.brainproducts.com/.

This class is a bridge between pyacq and the socket-based data streaming provided by the Vision recorder acquisition software.

after_output_configure(outputname)[source]

This method is called when one of the Node’s outputs has been configured.

It may be reimplemented by subclasses.

class pyacq.devices.Emotiv(**kargs)[source]

Simple eeg emotiv device to access eeg, impedances and gyro data in a Node.

Reverse engineering and original crack code written by Cody Brocious (http://github.com/daeken) Kyle Machulis (http://github.com/qdot) Many thanks for their contribution.

Emotiv USB emit 32-bytes reports at a rate of 128Hz, encrypted via AES see https://github.com/qdot/emokit/blob/master/doc/emotiv_protocol.asciidoc for more details

after_output_configure(outputname)[source]

This method is called when one of the Node’s outputs has been configured.

It may be reimplemented by subclasses.

class pyacq.devices.OpenBCI(**kargs)[source]

This class is a bridge between Pyacq and the 32bit board OpenBCI amplifier from the open source project http://openbci.com. Daisy board version for now

#TODO : this is a very basic code to grab data from 8 channel Daisy OpenBCI board. # next version will improve dialog with the board and auto-initialisation

after_output_configure(outputname)[source]

This method is called when one of the Node’s outputs has been configured.

It may be reimplemented by subclasses.

Testing

class pyacq.devices.NumpyDeviceBuffer(**kargs)[source]

A fake analogsignal device.

This node streams data from a predefined buffer in an endless loop.

after_output_configure(outputname)[source]

This method is called when one of the Node’s outputs has been configured.

It may be reimplemented by subclasses.

configure(*args, **kwargs)[source]
Parameters:
nb_channel: int

Number of output channels.

sample_interval: float

Time duration of a single data sample. This determines the rate at which data is sent.

chunksize: int

Length of chunks to send.

buffer: array

Data to send. Must have buffer.shape[0] == nb_channel.