Presentation: Difference between revisions

Jump to navigation Jump to search
No edit summary
Added examples on how to present audio in Presentation
Line 64: Line 64:
In Neurobs Presentation please use *exclusive mode* to get the best audio performance. This means that no other programs
In Neurobs Presentation please use *exclusive mode* to get the best audio performance. This means that no other programs
can use the audio device while the experiment runs.
can use the audio device while the experiment runs.
[[File:SoundSettings.png|thumb|Presentation Mixer Settings]]


The maximum audio delay in Presentation on a lab computer at the faculty of social sciences is 24 ms. If better performance  
The maximum audio delay in Presentation on a lab computer at the faculty of social sciences is 24 ms. If better performance  
is necessary or more understanding is needed about the components of this delay, please read our page about [[audio delay]].
is necessary or more understanding is needed about the components of this delay, please read our page about [[audio delay]].
'''How to present sounds in Presentation'''
in SDL:
<pre>
sound{
wavefile{
filename = "beep.wav"; # The name of the sound file.
preload=true; # Make sure that the sound is loaded before it is actually used.
  }myWave;
}mySound;
</pre>
Make sure to use '''preload = true;'''. This ensures that the sound is loaded into memory before the sound is used.
in PCL:
Prepare your stimuli during Inter Trial Interval, when there is enough time to do that. First, unload the previous sound, set the filename property to the new soundfile and load it.
<pre>
sub prepareTrial
begin
myWave.unload();
myWave.set_filename("beep.wav"); # or read the name from a trial list.
myWave.load();
end;
</pre>
During your experiment the sound is presented by:
<pre>
startOfPlaycall = clock.time();
mySound.present();
endOfPlaycall = clock.time();
</pre>


== Troubleshooting ==
== Troubleshooting ==