Skip to content

mscheltienne/stimuli

Repository files navigation

Ruff Code style: black Imports: isort codecov tests doc PyPI version Downloads Conda Version Conda Downloads Conda Platforms

Stimuli

This repository contains auditory stimuli that do not require PsychoPy. The auditory stimuli use the python sounddevice library.

Installation

This repository is available for python ≥ 3.11 on pip with the command pip install stimuli or on conda-forge with the command conda install -c conda-forge stimuli.

Usage

Audio stimulus

from stimuli.audio import Tone
from stimuli.time import sleep
from stimuli.trigger import ParallelPortTrigger

trigger = ParallelPortTrigger("/dev/parport0")
sound = Tone(frequency=1000, volume=80, duration=1)
sound.play(when=0.2)
sleep(0.2)
trigger.signal(1)