OS (e.g. Win10): Windows 10
PsychoPy version (e.g. 1.84.x): 2020.2.1
Standard Standalone? (y/n) If not then what?: Yes
What are you trying to achieve?:
I am running an experiment which uses the movie component. Videos are played that have their own audio, but the audio and video don’t sync up properly, which is important for my experiment. I was also getting a warning advising me to use PTB instead of sounddevice, which I thought might be the cause of the syncing issue, but when I switched to PTB the routine featuring the movie component now won’t run. Instead I get a grey screen and the loading wheel, and I have to force close the window to get out (‘Not Responding’).
What did you try to make it work?:
In Preferences I changed the order of audio library to [‘PTB’, ‘sounddevice’, ‘pyo’, ‘pygame’]. In Experiment Settings in the Audio tab I have ‘3: Aggressive low latency’ selected and ‘Use preferences’ for Audio library. I have also tried changing the Audio library here to ‘PTB’ which didn’t help.
What specifically went wrong when you tried that?:
Here is the error I get in the Experiment Runner:
Traceback (most recent call last):
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py", line 582, in stream
blockSize=self.blockSize)
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py", line 143, in getStream
blockSize=blockSize)
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py", line 183, in _getStream
.format(label, list(self.keys())[0], sys.platform)
psychopy.exceptions.SoundFormatError: Tried to create audio stream 44100_2_128 but 48000_2_128 already exists and win32 doesn't support multiple portaudio streams
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\visual\movie3.py", line 189, in loadMovie
sampleRate=self._mov.audio.fps)
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py", line 334, in __init__
hamming=self.hamming)
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py", line 428, in setSound
_SoundBase.setSound(self, value, secs, octave, hamming, log)
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\_base.py", line 198, in setSound
self._setSndFromArray(numpy.array(value))
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py", line 500, in _setSndFromArray
self.track = audio.Slave(self.stream.handle, data=self.sndArr,
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py", line 590, in stream
raise SoundFormatError(err)
psychopy.exceptions.SoundFormatError: Tried to create audio stream 44100_2_128 but 48000_2_128 already exists and win32 doesn't support multiple portaudio streams
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py", line 582, in stream
blockSize=self.blockSize)
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py", line 143, in getStream
blockSize=blockSize)
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py", line 183, in _getStream
.format(label, list(self.keys())[0], sys.platform)
psychopy.exceptions.SoundFormatError: Tried to create audio stream 44100_2_128 but 48000_2_128 already exists and win32 doesn't support multiple portaudio streams
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\g34890cw\Documents\PsychoPy\StudentCompExp\StudentExperiment_shortVideos_lastrun.py", line 764, in <module>
depth=-1.0,
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\contrib\lazy_import.py", line 120, in __call__
return obj(*args, **kwargs)
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\visual\movie3.py", line 140, in __init__
self.loadMovie(self.filename)
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\visual\movie3.py", line 198, in loadMovie
sampleRate=self._mov.audio.fps)
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py", line 334, in __init__
hamming=self.hamming)
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py", line 428, in setSound
_SoundBase.setSound(self, value, secs, octave, hamming, log)
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\_base.py", line 198, in setSound
self._setSndFromArray(numpy.array(value))
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py", line 500, in _setSndFromArray
self.track = audio.Slave(self.stream.handle, data=self.sndArr,
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_ptb.py", line 590, in stream
raise SoundFormatError(err)
psychopy.exceptions.SoundFormatError: ##### Experiment ended. #####
In case it helps, here is the error message I received once I force closed the experiment window:
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\runner\runner.py", line 277, in onClose
self.onQuit()
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\runner\runner.py", line 285, in onQuit
self.panel.stopTask()
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\runner\runner.py", line 545, in stopTask
self.stopFile(event)
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\runner\scriptProcess.py", line 109, in stopFile
self.onProcessEnded()
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\runner\runner.py", line 514, in onProcessEnded
ScriptProcess.onProcessEnded(self)
File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\runner\scriptProcess.py", line 140, in onProcessEnded
self.app.runner.stdOut.write(buff)
AttributeError: 'NoneType' object has no attribute 'stdOut'
I need a way to ensure my videos sync with their audio, and if the way to do this is to use the PTB audio library, I need to know how to do this without the experiment crashing!
In case it’s relevant, below is my flow. The experiment crashes (grey screen that doesn’t respond) when trying to start the ‘AOMI’ routine:
Here are the routine details:
Here is the info I have for the movie component:
The videos I am uploading are 38MB .MOV files.
Any help hugely appreciated!