This repository contains auditory stimuli that do not require PsychoPy. The auditory stimuli use the python sounddevice library.
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
.
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)