Captures sound from a microphone, then records it to file after the trial. Properties start/end set when recording starts and ends, and times reported in record properties startTime/endTime correspond to recording start/end—you can use these to analyze the times of recorded sounds relative to other things in the trial/experiment. Set recording volume in your system sound settings.
This uses the high-precision PortAudio driver in Psychtoolbox. A system can have multiple internal sound “devices”. If you want to change which sound device to use for recording or other parameters, you can use pb_prefs -> microphone tab. Or to change for only the current experiment, you can make an object of type microphone and set its properties. See help text for the Psychtoolbox function InitializePsychSound and generally the Psychtoolbox website and PsychPortAudio documentation for technical notes on PortAudio with different operating systems and hardware.
If an element can end on its own, you don't need to set end conditions for it in property end (unless you want it to maybe end earlier).
No—runs until a condition you set in property end.
You can vary or allow the subject to adjust the following input properties of an object of this type in real time when it's running. If you need to make other properties adjustable, you can edit the element type code—see Element Type Programming Manual.
position
nn_eyes
rotation
colorMask
alpha
intensity
contrastMult
drawCodeVars
(None)
(None)
No default: fileName
Default: numberFile = automatically number files
Default: minNumDigitsInFileName = 1
numberFile = <cd>true<cd>/<cd>false<cd>: If = <cd>true<cd> (default), the sound recorder adds a number to file name starting at 1 and incrementing to not overwrite any existing files. This means if you have multiple soundRecorder elements in an experiment, you can set fileName the same for all of them (e.g. sound.wav) and they will write different files numbered in the order they run (e.g. sound1.wav, sound2.wav, sound3.wav, ...). NOTE: If you set numberFile = <cd>false<cd> then the element will not add a number and will overwrite any existing file with the specified name.
minNumDigitsInFileName sets the minimum number of digits to use for numbering files. e.g. 3 → sound001.wav, sound002.wav, sound003.wav, ...
See also record properties fileName_r, n_file below.
Default: bitDepth = 24
Default: bitRate = 256
For a .mp4 or .m4a file, you can optionally specify bit rate to compress at in bitRate.
Default: 0.5 sec
Alternatively, 0 = don't wait and disable the warning that report was not received. This can be useful if you are getting the warning in an experiment where timing doesn't matter.
PsychBench uses record properties to record information during experiments. You can't set record properties but you can see them in experiment results by listing them input property report.
fileName_r is a string recording the file name written to. This includes the number added if numberFile = <cd>true<cd>.
n_file records the number added (numeric) if numberFile = <cd>true<cd>.
PsychBench © 2017–2023 Giles Holland
Website © 2023 Giles Holland
End user license agreement