Sound handling problem - MacOS to Windows

Hi everyone !

I am desperate. I have an experiment that works perfectly fine on my own MacOS computer, and on the MacOS laptop of my supervisor. But after sending it to my second supervisor, on Windows, the experiment does not handle the sound feedback anymore.
The sounds are two .mp3 files. They can be opened and played independently on the Windows computer, outside of psychopy. But whenever we try to run the script, it ends with this error :

C:\Users\aavargues\Downloads\LAST_MANIP_Color_OldMask\1A_EXPE_LANCEMENT.py

pygame 2.1.0 (SDL 2.0.16, Python 3.8.10)
Hello from the pygame community. Contribute - pygame wiki
7.8278 WARNING Monitor specification not found. Creating a
temporary one…
Traceback (most recent call last):
7.8352 WARNING User requested fullscreen with size [1280 800],
but screen is actually [1920, 1080]. Using actual size
File
“C:\Users\aavargues\Downloads\LAST_MANIP_Color_OldMask\1A_EXPE_LANCEMENT.py”,
line 33, in
f_expe_couleurs_C3 (LOGFILE)
File
“C:\Users\aavargues\Downloads\LAST_MANIP_Color_OldMask\expe_couleurs_C3.py”,
line 118, in f_expe_couleurs_C3
fbaudio[1]= Sound(value=‘beep-ok.mp3’, secs=0.5, stopTime=0.5)
File
“C:\Users\aavargues\AppData\Local\Programs\PsychoPy\lib\site-packages\psychopy\sound\backend_ptb.py”,
line 332, in init
self.setSound(value, secs=self.secs, octave=self.octave,
File
“C:\Users\aavargues\AppData\Local\Programs\PsychoPy\lib\site-packages\psychopy\sound\backend_ptb.py”,
line 440, in setSound
_SoundBase.setSound(self, value, secs, octave, hamming, log)
File
“C:\Users\aavargues\AppData\Local\Programs\PsychoPy\lib\site-packages\psychopy\sound_base.py”,
line 185, in setSound
self._setSndFromFile(p)
File
“C:\Users\aavargues\AppData\Local\Programs\PsychoPy\lib\site-packages\psychopy\sound\backend_ptb.py”,
line 446, in _setSndFromFile
self.sndFile = f = sf.SoundFile(filename)
File
“C:\Users\aavargues\AppData\Local\Programs\PsychoPy\lib\site-packages\soundfile.py”,
line 629, in init
self._file = self._open(file, mode_int, closefd)
File
“C:\Users\aavargues\AppData\Local\Programs\PsychoPy\lib\site-packages\soundfile.py”,
line 1183, in _open
_error_check(_snd.sf_error(file_ptr),
File
“C:\Users\aavargues\AppData\Local\Programs\PsychoPy\lib\site-packages\soundfile.py”,
line 1357, in _error_check
raise RuntimeError(prefix + _ffi.string(err_str).decode(‘utf-8’,
‘replace’))
RuntimeError: Error opening ‘beep-ok.mp3’: File contains data in an
unknown format.
################ Experiment ended with exit code 1 [pid:18240]
#################

We also tried to convert the files to .wav, but same issue. Then we tried with other .wav files, used successfully in other experiments previously, but we got another error “malformed ‘fmt’ chunk”…
When we remove the sound feedback, the experiment runs perfectly on Windows. What could be the problem and what can I do to fix it ?

Thank you so much for your help ! :smiley:

Since I know that .mp3 files don’t work locally (I use ogg or wav) then please can you show an error message using a wav file? mp3 files do work online.

You might need a bit rate of 48kHz.