Beeper Element

Modified on 2018/07/16 02:01 by Administrator — Categorized as: Auditory Stimuli, Base Elements, Elements

Summary

Element Icon Beeper
Info
Category: Audio Stimuli AddIn: Base Layer
Creator: OkazoLab Scope: Parent event
Owns Snippets: None Usage: Snippets

Properties

NameDescription                              ConstraintsTypeOn
runtime
change
Settings
Test Beep                         Boolean         
Working Mode        Defines a mode of producing a beep. If the manual mode is chosen, a beep has to be controlled by setting the Is Playing property. Otherwise, a beep is started automatically at the onset of the parent event.                stBeep..         
Beep
Frequency        The beep frequency,in Hz (greater than 0)                Int32         
Duration        Defines the beep duration (in ms). The valid range is 0..10000                Int32         
Runtime
Is Playing        Indicates whether a beep is currently playing (at the runtime). The property can be used to start and stop a beep in the manual mode by assigning a boolean value to it at runtime                Boolean         
Start time        Indicates the local event time when a beep has been started (in ms).                clTime         
Control
Is Enabled        If set to false the element is completely omitted when the experiment is run                Boolean         
Title        Title of the element                String         

Beeper Element is capable to generate and play a square sound wave (beep) of the requested frequency and duration via PC speaker.The element is a best choice for delivering simple auditory stimuli with the highest temporal precision.

Description

Beeps are played by a hardware tone generator called PC speaker. Due to simple hardware implementation, the sound generation and playback via PC speaker is characterized by a high temporal precision which is barely possible with the conventional sound cards. However, PC speaker cannot play complex sounds other than single tones and also has a little control on the playback process. You can use this element to generate auditory stimuli in the experimental scenarios where very accurate timing is important and simple sounds are sufficient. If you wish to have more controllable and complex auditory stimuli (still with a good temporal precision of playback) use the DirectSound element. Alternatively, in scenarios where temporal precision is not necessary you can use the Audio Player element that supports the widest range of sound formats.

Practical Use

The Beeper element can work in one of two working modes that define the synchronization of the sound playback:

Manual working mode

In this mode the element plays a beep on a manual request made in code snippets at will time. The playback is initiated as the element's property [IsPlaying] is assigned to true. Later, the same property can be used to monitor if the initiated beep is still currently playing. [IsPlaying] property automatically turns to false when the initiated playback ends. At this moment and later you can initiate a new playback under a condition that the parent event is still active.

Auto working mode

In this mode the element starts to play a beep synchronously with activation of the parent event. IsPlaying property can be used to monitor if the initiated beep is still currently playing. In this working mode you can initiate a playback manually (by assigning true to IsPlaying property) only after the synchronized playback ends.

Notes