0

I wonder if anyone can see an error. I am running an experiment with approximately 220 trials. There are 3 auditory stimuli that I want to turn on for a variable amount of time and terminate when the 'space' is pressed (on some trials). At about trial 148 I get an error, indicating that the sound is the issue and the last line is "memory Error'

Specifically:

if self.lineRGB!=None and self.lineWidth!=0.0: Traceback (most recent call last): File "C:\Users\freemali\Desktop\UGH_lastrun.py", line 4352, in short_stim3 = sound.Sound('C', secs=short_dur) File "C:\Program Files\PsychoPy2\lib\site-packages\psychopy-1.81.00-py2.7.egg\psychopy\sound.py", line 217, in init self.setSound(value=value, secs=secs, octave=octave) File "C:\Program Files\PsychoPy2\lib\site-packages\psychopy-1.81.00-py2.7.egg\psychopy\sound.py", line 135, in setSound self._setSndFromNote(value.capitalize(), secs, octave, hamming=hamming) File "C:\Program Files\PsychoPy2\lib\site-packages\psychopy-1.81.00-py2.7.egg\psychopy\sound.py", line 167, in _setSndFromNote self._setSndFromFreq(thisFreq, secs, hamming=hamming) File "C:\Program Files\PsychoPy2\lib\site-packages\psychopy-1.81.00-py2.7.egg\psychopy\sound.py", line 177, in _setSndFromFreq self._setSndFromArray(outArr) File "C:\Program Files\PsychoPy2\lib\site-packages\psychopy-1.81.00-py2.7.egg\psychopy\sound.py", line 291, in _setSndFromArray thisArray= (thisArray*2**15).astype(numpy.int16) MemoryError

Is this a result of Psychopy not releasing the auditory stimuli? Because I want the stimuli on for a variable period of time, I am using stimulus.stop() at the end of the routine. Is this an issue?

M--
  • 25,431
  • 8
  • 61
  • 93
Katie
  • 323
  • 3
  • 10
  • Are you using Coder or Builder? How long are the sounds? Are they beeps generated by PsychoPy or an audio file (if so, which format?)? It could be that you are initiating a whole new ``sound.Sound()`` stimulus on every trial where you should just create the three sounds that you want before entering the trial phase and then play the appropriate one there. – Jonas Lindeløv Nov 05 '14 at 08:22
  • Please update your question with the answers my questions. And maybe put in line breaks on the error - it's a bit hard to read right now. – Jonas Lindeløv Nov 05 '14 at 08:24
  • I am using the builder. The tones are between 3 and 16 seconds. They are generated by PsychoPy. I only initialize once, before the trials begin, and then change the duration of the tone at certain trial numbers. here is the error again its not an error it is just what comes out of the output when the program crashes... files "C://Program Files\ PsychoPy2\lib\site-packages\psychopy-1.81.00-py2.7.egg\psychopy\sound.py", line 281 in setSendFromArray thisArray=(thisArray*2**15).astype(numpy.int16) Memory Error – Katie Nov 05 '14 at 22:34
  • I think that the code is nicely written and it should not be an issue--the stimuli are not that long. I just present quite a few of them. – Katie Nov 05 '14 at 22:43
  • Thanks, then I'm out of suggestions. It does not seem to be related to any of the possibilities I suggested. – Jonas Lindeløv Nov 06 '14 at 09:32
  • An old question, but it's worth bearing in mind that some Python programs are not well-tested on Windows. – halfer Nov 25 '15 at 20:12

0 Answers0