snd on windows

hi,

I'm a bit confused about the asynchronousity aspect of SND on Windows
2000, Matlab 5.3.

It seems that a call to 'getSecs' will not execute while a sound is
playing. However, a key press will be recorded using something like
'getChar'. For example, this code:

beep = makebeep(1500, 1);
t1 = getSecs;
snd('Play', beep);
g = getChar
t2 = getSecs;
RT = t2-t1

indicates the same RT regardless of the time the key was pressed at
(assuming the key press is in the duration of the beep), although it
still records which key was pressed. Any help on this would be much
appreciated.

Incidently, the duration parameter of MakeBeep is not in seconds (as
help file says), and the 'Open' and 'Quiet' options of SND do not
work.

Thanks - Lewis Bott
Lewis,

The duration parameter may be off (i.e. not in seconds) because you're not setting the sampling rate. On the PC, the default for play is 8192, while the default for makebeep is 22254. Try setting the sampling rate, and the duration may work better.

The following modified version of your code should make the duration more accurate:

beep = makebeep(1500, 1, 22000);
t1 = getSecs;
snd('Play', beep, 22000);
g = getChar
t2 = getSecs;
RT = t2-t1

I've always found snd to be pretty buggy, though.

Hope this helps,
John