[beep,samplingRate] =
MakeBeep(freq,duration,[samplingRate])
Compute array that can be used by
Snd to produce a pure tone of specified
"freq" (Hz) and "duration" (s). The "samplingRate" defaults to
Snd('
DefaultRate').
beep =
MakeBeep(freq,duration);
Snd('Open');
.... do some stuff ....
Snd('Play',beep);
See
Snd.
Psychtoolbox/PsychOneliners/MakeBeep.m