![]() ![]() Sound_1.stop() # ensure sound has stopped at end of routine If hasattr(thisComponent, "setAutoDraw"): If continueRoutine: # don't flip if this routine is over or we'll get a blank screen If hasattr(thisComponent, "status") and thisComponent.status != FINISHED:īreak # at least one component has not yet finished If not continueRoutine: # a component has requested a forced-end of RoutineĬontinueRoutine = False # will revert to True if at least one component still running Sound_1.play() # start the sound (it finishes automatically) Sound_1.frameNStart = frameN # exact frame index # keep track of start time/frame for later If t >= 0.0 and sound_1.status = NOT_STARTED: # keep track of which components have finishedįrameN = frameN + 1 # number of completed frames (so 0 is the first frame) # update component parameters for each repeat Os.chdir(_thisDir) Store info about the experiment sessionĮxpName = ‘BA Experiment’ # from the Builder filename that created this scriptĮxpInfo = thisTrial’.format(paramName)) # -Prepare to start Routine "trial". _thisDir = os.path.dirname(os.path.abspath( file)).decode(sys.getfilesystemencoding()) Import sys # to get file system encoding Ensure that relative paths start from the same directory as this script Import os # handy system and path functions Sqrt, std, deg2rad, rad2deg, linspace, asarray)įrom numpy.random import random, randint, normal, shuffle ![]() Import numpy as np # whole numpy lib is available, prepend ‘np.’įrom numpy import (sin, cos, tan, log, log10, pi, average, STOPPED, FINISHED, PRESSED, RELEASED, FOREVER) doi: 10.3389/neuro.11.010.2008įrom future import absolute_import, divisionįrom psychopy import locale_setup, sound, gui, visual, core, data, event, logging, clockįrom nstants import (NOT_STARTED, STARTED, PLAYING, PAUSED, Peirce, JW (2009) Generating stimuli for neuroscience using PsychoPy.įrontiers in Neuroinformatics, 2:10. Journal of Neuroscience Methods, 162(1-2), 8-13. Peirce, JW (2007) PsychoPy - Psychophysics software in Python. If you publish work using this script please cite the PsychoPy publications: This experiment was created using PsychoPy2 Experiment Builder (v1.90.2), “value error: nonbrodcastable output operant with shape (128,1) doesn’t match the brodcast shape (128,2)” The soundfiles work perfectly fine if i type them in directly, but if i want the loop to put in the soundfiles with an Excel file I get an Error: I am trying to play soundfiles (.wav) through a loop. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |