Errors with open .wav file

Hi the community,

Operating System: Windows-10-10.0.18362-SP0
version: psychopy3
python 3.6

I am trying to create sound components with audio files. The .wav files are under the same parent folder as the project file. In the condition file, the relative path to each .wav file is given and the sound component path is set up with the column name.

What did you try to make it work?:
I have tried change the file name to .aiff and I am sure the path should have no errors. I also installed FFmpeg so that the .wav can be handled.

What specifically went wrong when you tried that?:

Traceback (most recent call last):
  File "E:\UNC\PhD\Comp ex and Disser\Proposal\Psychopy\WM verbal\WMverbal_lastrun.py", line 115, in <module>
    sound_1.setSound(savepath, hamming=True)
  File "E:\Installed_program\PsychoPy3\lib\site-packages\psychopy\sound\backend_sounddevice.py", line 361, in setSound
    _SoundBase.setSound(self, value, secs, octave, hamming, log)
  File "E:\Installed_program\PsychoPy3\lib\site-packages\psychopy\sound\_base.py", line 195, in setSound
    self._setSndFromFile(p)
  File "E:\Installed_program\PsychoPy3\lib\site-packages\psychopy\sound\backend_sounddevice.py", line 395, in _setSndFromFile
    self.sndFile = f = sf.SoundFile(filename)
  File "E:\Installed_program\PsychoPy3\lib\site-packages\soundfile.py", line 627, in __init__
    self._file = self._open(file, mode_int, closefd)
  File "E:\Installed_program\PsychoPy3\lib\site-packages\soundfile.py", line 1182, in _open
    "Error opening {0!r}: ".format(self.name))
  File "E:\Installed_program\PsychoPy3\lib\site-packages\soundfile.py", line 1355, in _error_check
    raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace'))
RuntimeError: Error opening 'Sam_stopped_the_fire.wav': File contains data in an unknown format.

Thanks,

Hello,

do you mind uploading the wav-file? There seems to be a format error.

Best wishes Jens

Hi

Thanks for response and sorry for the delay. Sure here are some examples.

Hello littlethumb123

all your examples are mono 32 bit 24,000 Hz. You might want to try 16 bit, 44,1000 Hz instead.

Best wishes Jens

Thank you. It works. Just in case other folks may have the same issues, Audacity can configure the sample rate and file format for this issue.

1 Like