How can i import audio sound - wav files from my computer into the psychopy coder?

Hi everyone

I’m a master student working on my own research project. My project contains audio fragments as stimuli. I don’t know how i can import these fragments into the psychopy coder (v2021.2.3) and use them as stimuli. I already converted my audio fragments to wav files.

(The purpuse of my research project is to let participants hear the audio fragment and they have to respond with two keys of the keyboard to the question in the fragment.)

Is there anyone who can help me?

Thank you in advance!
Kaat

You simply create “Sound” objects that load each of the files individually, and then you can do whatever you want with them.

from psychopy import sound
newSound = sound.Sound('stim.wav')
newSound.play()

It basically behaves like any other type of stimulus in PsychoPy except that instead of drawing it onto the screen, you control audio playback with play() and stop(). You can get more details on the different playback systems PsychoPy uses from here:

https://psychopy.org/api/sound/playback.html

Super, Dank u wel!