From a3209d56d203ba4d93c7ce810a05de41e1edd6ed Mon Sep 17 00:00:00 2001 From: Mathieu Scheltienne Date: Wed, 2 Oct 2024 16:48:15 +0200 Subject: [PATCH] fix typo and add code-block --- tutorials/40_sychronize_sound_and_trigger.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tutorials/40_sychronize_sound_and_trigger.py b/tutorials/40_sychronize_sound_and_trigger.py index 7625734..cd01474 100644 --- a/tutorials/40_sychronize_sound_and_trigger.py +++ b/tutorials/40_sychronize_sound_and_trigger.py @@ -46,7 +46,22 @@ # .. image:: ../../_static/performance.png # :align: center # -# On different computers with different soundards, the performance may vary. For +# On different computers with different soundcards, the performance may vary. For # instance, with on-board soundcards on Linux, both psychtoolbox and stimuli are usually # perfectly synchronized with the trigger. In the end, the performance should always be # measured on the target system. +# +# .. code-block:: python +# +# from stimuli.audio import Tone +# from stimuli.time import sleep +# from stimuli.trigger import ParallelPortTrigger +# +# sound = Tone(frequency=440, volume=100, duration=0.3) +# trigger = ParallelPortTrigger("/dev/parport0") +# +# for k in range(10): +# sound.play(when=0.2) +# sleep(0.2) +# trigger.signal(1) +# sleep(0.5)