# Problem playing sound files in psychopy

**URL:** <https://discourse.psychopy.org/t/problem-playing-sound-files-in-psychopy/13645>\
**Category:** Builder\
**Created:** [May 24, 2020, 5:45pm UTC](https://discourse.psychopy.org/t/problem-playing-sound-files-in-psychopy/13645 "2020-05-24T17:45:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Agnieszka](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@Agnieszka](https://discourse.psychopy.org/u/Agnieszka)\
**Post date:** [May 24, 2020, 5:45pm UTC](https://discourse.psychopy.org/t/problem-playing-sound-files-in-psychopy/13645/1 "2020-05-24T17:45:11Z")

</div>

I have an experiment in which participants listen to a recording (a .wav file) on each trial. My experiment worked perfectly last week (offline PsychoPy) and today it no longer works – it suddenly crashes after the first trial (though I’ve made no changes at all). The error message I get is this:

devnames = sorted(sound.getDevices(‘output’))  
AttributeError: module ‘psychopy.sound’ has no attribute ‘getDevices’

And this:

2.5782 WARNING We strongly recommend you activate the PTB sound engine in PsychoPy prefs as the preferred audio engine. Its timing is vastly superior. Your prefs are currently set to use [‘pygame’, ‘sounddevice’, ‘PTB’, ‘pyo’] (in that order).  
16.5237 WARNING Hamming was requested using the ‘pygame’ sound library but hamming is not supported there.

I don’t know what this means (I’m very new to PsychoPy) and what I need to check. If I go to File --\> Preferences, nothing happens (i.e., there’s no pop-up window with preferences). I’m lost! Are there settings/updates I need to be aware of?

Many thanks in advance!  
AK

---

<div class="post-metadata">

**Author:** ![aisa2](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/aisa2/32/8666_2.png) [@aisa2](https://discourse.psychopy.org/u/aisa2)\
**Post date:** [May 25, 2020, 2:59pm UTC](https://discourse.psychopy.org/t/problem-playing-sound-files-in-psychopy/13645/2 "2020-05-25T14:59:22Z")

</div>

I haven’t encountered this problem before, but maybe you have plugged/unplugged your headphones, or external speakers? This seems like psychopy cannot find which output device to play the sound from. Or maybe pygame is interfering by changing your audio settings?

---

<div class="post-metadata">

**Author:** ![Agnieszka](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@Agnieszka](https://discourse.psychopy.org/u/Agnieszka)\
**Post date:** [May 25, 2020, 3:16pm UTC](https://discourse.psychopy.org/t/problem-playing-sound-files-in-psychopy/13645/3 "2020-05-25T15:16:56Z")

</div>

No idea. I uninstalled and reinstalled PsychoPy… That fixed it. It just looks like some setting was upgraded recently which made the “old” (one-week-old) experiment crash 😉

---

<div class="post-metadata">

**Author:** ![Rb\_Zhon](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/rb_zhon/32/9993_2.png) [@Rb\_Zhon](https://discourse.psychopy.org/u/Rb_Zhon)\
**Post date:** [December 9, 2020, 1:28pm UTC](https://discourse.psychopy.org/t/problem-playing-sound-files-in-psychopy/13645/4 "2020-12-09T13:28:33Z")

</div>

I got this question when playing videos.
