Audio sample rate 16000.000000 Hz is not supported by hardware and sound driver

OS (e.g. Win10): Windows 10
PsychoPy version (e.g. 1.84.x): 2021.2.3
**Standard Standalone? : yes
What are you trying to achieve?:
I am trying to run an experiment that records participants’s voices as they say sentences corresponding to the images they see. The experiment was running fine locally when I was using the version 2020.2.10. I downloaded the new version 2021.2.3 and now I am stuck on an error that appears as soon as I start the experiment:

PTB-ERROR: Desired audio parameters for device 5 unsupported by audio device: Invalid sample rate
PTB-ERROR: Seems the requested audio sample rate 16000.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]);
8.4868 WARNING User requested fullscreen with size [1536 864], but screen is actually [1920, 1080]. Using actual size
Traceback (most recent call last):
File “D:\ordi\IDEALAB\Psychopy\Exp1_lastrun.py”, line 266, in
sampleRateHz=16000, maxRecordingSize=24000.0
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\sound\microphone.py”, line 483, in init
channels=self._channels)
File “C:\Program Files\PsychoPy\lib\site-packages\psychtoolbox\audio.py”, line 101, in init
flags)
Exception: Failed to open PortAudio audio device due to unsupported combination of audio parameters.
Exception ignored in: <bound method Stream.del of <psychtoolbox.audio.Stream object at 0x000001FB74205BA8>>
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: ‘Stream’ object has no attribute ‘handle’

Experiment ended.

What did you try to make it work?:
I tried changing the sampling rate and using the pyo library but I had the exact same error message everytime.
I also tried to connect and disconnect a headset with an incorporated microphone (wasn’t sure it would do anything but it’s best to try everything possible). It does not change anything.
I tried looking at the microphone and audio python files to see if there is no underlying issue but I’m not a coder at all so I could be missing something.
I also tried running it by selecting version 2020.2.10 in the Properties section considering it used to work before I downloaded version 2021.2.3. I still end up with the same error message.

Is it actually possible that the the experiment is not compatible with my hardware and there is no way around it? Would you recommend I uninstall psychopy and try installing a previous version? Could it be that it has to do with some lines of codes in the python files?

If anyone has any idea, it would be greatly appreciated as I have already spent almost an entire day on this issue and really need to get this up and running.
Thank you!

Hello,

I don’t know why this error did not show up in the earlier version of PsychoPy you have been using. But audio file, hardware and requested sound library must support the requested sampling frequency.

Check the sampling frequency of your audio files, the sampling frequency of your hardware and check the manual to determine which audio-library supports is best for your experiment Sound - for audio playback — PsychoPy v2021.2.

Best wishes Jens

Hi Jens,
Thank you for your quick reply. It turns out the preferences I had set for the sampling frequency were not taken into account (or at least I’m guessing this is what happened). I changed it from 16000 to 48000 in the last run python file. I am not sure this is a recommended step but everything seems to be working again. I will try to re-create the experiment to see if it would have the same issue when I have the time but at least now I can go back to testing.
Thank you again!
Best,
Solveig