You are viewing unmaintained documentation for an older version of OpenSesame. Click here to view the current documentation. Your version of OpenSesame: Language:
OpenSesame 3.0.0 will bring amazing new features! Curious? Take it for a test spin, and help us iron out the kinks.

Sound playback and timing

Overview

The sampler item

The sampler item provides an easy way to play back sound files (Figure 1).

Important note: If you find that your sample plays to slowly (low pitch) or too quickly (high pitch), make sure that the sampling rate of your sample matches the sampling rate of the sampler back-end as specified under back-end settings.

/usage/img/sound/sampler.png

Figure 1. The sampler item.

The synth item

The synth item provides an easy way to generate and play back simple generated sounds (Figure 2).

/usage/img/sound/synth.png

Figure 2. The synth item.

Timing

By default, OpenSesame uses PyGame for sound playback. PyGame is stable and robust, but it’s timing properties are quite poor. In practice, you should expect a temporal jitter of around 30ms. Therefore, if you require very accurate temporal precision when presenting auditory stimuli you may want to write an inline_script that plays back sound using a different module, such as PyAudio.

Some benchmarks tests of PyGame sound timing can be found on the Expyriment wiki:

Sound input

For information about sound input, see this page: