Changes

Jump to navigation Jump to search
988 bytes added ,  15:51, 1 April 2019
no edit summary
Line 65: Line 65:  
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]]
+
[[File:SoundSettings.png|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  
Line 76: Line 76:  
<pre>
 
<pre>
 
sound{
 
sound{
wavefile{
+
    wavefile{
filename = "beep.wav"; # The name of the sound file.
+
        filename = "beep.wav"; # The name of the sound file.
preload=true; # Make sure that the sound is loaded before it is actually used.
+
        preload=true; # Make sure that the sound is loaded before it is actually used.
  }myWave;
+
    }myWave;
 
}mySound;
 
}mySound;
 
</pre>
 
</pre>
Line 92: Line 92:  
sub prepareTrial  
 
sub prepareTrial  
 
begin
 
begin
myWave.unload();
+
    myWave.unload();
myWave.set_filename("beep.wav"); # or read the name from a trial list.
+
    myWave.set_filename("beep.wav"); # or read the name from a trial list.
myWave.load();
+
    myWave.load();
 
end;
 
end;
 
</pre>
 
</pre>
Line 104: Line 104:  
endOfPlaycall = clock.time();
 
endOfPlaycall = clock.time();
 
</pre>
 
</pre>
 +
 +
Please note that the moment when the sound can actually be heard from the speakers is later then the moment when the '''mySound.present()''' function is called. In our labs [march 2019], the delay (from '''startOfPlaycall''' until actual sound onset) is about 14 to 24 milliseconds when the Presenation mixer is used in exclusive mode. The function itself takes some (variable) time to execute. That time can, in the example above, be calculated by '''endOfPlaycall - startOfPlaycall'''. Then, some additional time is required before the sound actually is heard from the speakers. In our labs, that additional delay (from '''endOfPlaycall''' until actual sound onset) is about 5 to 8 milliseconds [March 2019]. When your experiment requires an exact knowledge about when the sound actually plays from the speakers, you need additional hardware, for instance a buttonbox with a soundkey.
 +
 +
More information about sound delays is found on our page about [[audio delay]].
    
== Troubleshooting ==
 
== Troubleshooting ==

Navigation menu