psychopy.org | Reference | Downloads | Github

What sound file types are supported in PsychoPy - unable to open an mp3

Windows 7
PsychoPy 1.84.2
PsychoPy provided as an APPV application.

Hi Folks,

What types of sound file are supported by the sound component in PsychoPy? The background to this is below.

A student had created their own stimulus on a phone (.m4a format) then converted it to mp3. Neither file would play via the sound component (see error message below). Once the file was converted to .wav file the sound component played successfully. All types of file played correctly outside of PsychoPy e.g. with VLC player.

raise TypeError(msg % fileName)
TypeError: Could not open sound file wordsFromRabia.mp3 using pyo; not found or format not supported.

If only .wav files are supported can we add this to the documentation?

With thanks,

S Robertson.

PsychoPy supports various sound engines. The main ones are using a library called libsndfile (http://www.mega-nerd.com/libsndfile/) to load files from disk and this doesn’t support mp3. It does support a variety of other options (ogg, flac, aiff) but mp3 is a proprietary format that would require fees to be paid. As this (PsychoPy, pyo, libsndfile) is all free software we have no way to pay those fees.

2 Likes

Lovely. Thanks for the information re mp3 and link to the library.