Skip to content

Commit

Permalink
improve tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
mscheltienne committed Oct 2, 2024
1 parent 79546be commit a9a2558
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Binary file added doc/_static/performance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions tutorials/40_sychronize_sound_and_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
First, let's have a look at our default device latency.
"""

# sphinx_gallery_thumbnail_path = '_static/performance.png'

import sounddevice as sd

from stimuli.audio import SoundAM
Expand All @@ -35,3 +37,16 @@
sound.play(when=0.5, blocking=False)
sleep(0.5)
trigger.signal(1)

# %%
# A quick measurement on a dual-boot Windows/Linux computer connected to a USB Crimson 3
# soundcard shows that the delay and jitter of ``stimuli`` are similar to
# ``psychtoolbox`` on linux.
#
# .. image:: ../../_static/performance.png
# :align: center
#
# On different computers with different soundards, the performance may vary. For
# instance, with on-board soundcards on Linux, both psychtoolbox and stimuli are usually
# perfectly syncrhonized with the trigger. In the end, the performance should always be
# measured on the target system.

0 comments on commit a9a2558

Please sign in to comment.