Using psychopy standalone v2023.2.0 on a windows 10
-
when trying to install the plugin for the sounddevice
it is collecting incompatible version of numpy (1.24.4
) with what this version of psychopy needs (<1.24.0
)
- Also after unsuccessful install the software thinks it is installed since if I try to install the plugin again it says it is installed and no option for uninstall.
-
when trying the PTB backend I get the following error for following minimal script:
Script
import psychtoolbox as ptb
from psychopy import sound
mySound = sound.Sound('assets/audio/sound.wav')
now = ptb.GetSecs()
mySound.play(when=now+0.5) # play in EXACTLY 0.5s
Error
########### Running: C:\Users\shafieim\codes\seal\npad\task\test.py ############
PTB-ERROR: Desired audio parameters for device -1 unsupported by audio device: Invalid sample rate
Traceback (most recent call last):
PTB-ERROR: Seems the requested audio sample rate 22050.000000 Hz is not supported by this combo of hardware and sound driver.
Error in function Open: Usage error
Failed to open PortAudio audio device due to unsupported combination of audio parameters.
PsychPortAudio:Open: Usage:
pahandle = PsychPortAudio('Open' [, deviceid][, mode][, reqlatencyclass][, freq][, channels][, buffersize][, suggestedLatency][, selectchannels][, specialFlags=0]);
PTB-ERROR: Desired audio parameters for device -1 unsupported by audio device: Invalid sample rate
PTB-ERROR: Seems the requested audio sample rate 22050.000000 Hz is not supported by this combo of hardware and sound driver.
Error in function Open: Usage error
Failed to open PortAudio audio device due to unsupported combination of audio parameters.
PsychPortAudio:Open: Usage:
pahandle = PsychPortAudio('Open' [, deviceid][, mode][, reqlatencyclass][, freq][, channels][, buffersize][, suggestedLatency][, selectchannels][, specialFlags=0]);
0.9626 ERROR Support for the `sounddevice` audio backend is not available this session. Please install `psychopy-sounddevice` and restart the session to enable support.
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\sound\backend_ptb.py", line 227, in __init__
audio.Stream.__init__(self, device_id=deviceID, mode=mode+8,
File "C:\Program Files\PsychoPy\lib\site-packages\psychtoolbox\audio.py", line 97, in __init__
self.handle = PsychPortAudio('Open', device_id, mode,
Exception: Failed to open PortAudio audio device due to unsupported combination of audio parameters.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\[...]\task\test.py", line 4, in <module>
mySound = sound.Sound('assets/audio/sound.wav')
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\sound\backend_ptb.py", line 332, in __init__
self.setSound(value, secs=self.secs, octave=self.octave,
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\sound\backend_ptb.py", line 440, in setSound
_SoundBase.setSound(self, value, secs, octave, hamming, log)
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\sound\_base.py", line 185, in setSound
self._setSndFromFile(p)
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\sound\backend_ptb.py", line 476, in _setSndFromFile
self._setSndFromArray(sndArr)
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\sound\backend_ptb.py", line 515, in _setSndFromArray
self.track = audio.Slave(self.stream.handle, data=self.sndArr,
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\sound\backend_ptb.py", line 621, in stream
label, s = streams.getStream(sampleRate=self.sampleRate,
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\sound\backend_ptb.py", line 140, in getStream
return self._getStream(sampleRate,
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\sound\backend_ptb.py", line 187, in _getStream
self[label] = _MasterStream(sampleRate, channels, blockSize,
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\sound\backend_ptb.py", line 248, in __init__
audio.Stream.__init__(self, mode=mode+8,
File "C:\Program Files\PsychoPy\lib\site-packages\psychtoolbox\audio.py", line 97, in __init__
self.handle = PsychPortAudio('Open', device_id, mode,
Exception: Failed to open PortAudio audio device due to unsupported combination of audio parameters.
Exception ignored in: <function Stream.__del__ at 0x0000022DD3A1EEE0>
Traceback (most recent call last):
File "C:\Program Files\PsychoPy\lib\site-packages\psychtoolbox\audio.py", line 236, in __del__
self.close()
File "C:\Program Files\PsychoPy\lib\site-packages\psychtoolbox\audio.py", line 146, in close
raise err
File "C:\Program Files\PsychoPy\lib\site-packages\psychtoolbox\audio.py", line 139, in close
PsychPortAudio('Close', self.handle)
AttributeError: '_MasterStream' object has no attribute 'handle'
Any tips?
Thanks