Paired comparison/forced choice task using audio stimuli

OS (e.g. Win10): Mac 14.6.1
PsychoPy version (e.g. 2024.2.4 Py 3.8): 2025.2.3
Standard Standalone Installation? (y/n) y
Do you want it to also run online? (y/n) y, on Pavlovia

Hi all, I’m new to PsychoPy and I’m struggling both conceptually and practically, so I’d appreciate any help folks can offer. Please assume that I don’t know what I’m doing and don’t really know how to implement anything.

I’m trying to create an experiment that’s a paired comparison/forced choice task. Participants will be presented with two audio stimuli that they can start, stop, and repeat so they can listen to both stimuli as many times as they like. (The stimuli shouldn’t autoplay when the screen loads; they shouldn’t play until the participant wants to hear them but the participant can play them as many times as they like.) The participant will then answer a question about the pair that will require them to select one of the stimuli, and answer a question about their confidence in their answer on a slider or something. (It would also be SUPER helpful if the program forced the participants to actually LISTEN to both of the stimuli before answering, but maybe that’s a question for a different time since I can’t even figure out how to do the basic stuff yet.) There isn’t a right or wrong answer for the question; what I’m interested in is in creating a sort of ranked list in how the stimuli are perceived in comparison to one another, so the data that comes out would have to be helpful in that process. Each participant will hear 20-30 randomly selected pairs of stimuli (out of about 100 pairs total) and answer the question & confidence interval for each pairing.

I know I need to create a list of the possible pairs of stimuli, but I can’t figure out how to format it so that it loads and displays the audio files so that participants can control the playback, and I also have no idea how to format the experiment screen so that the instructions, audio files, question, and confidence rating all appear for each pairing.

I’ve been reading lots of other posts here and trying to figure it out, and going through the tutorials, but I just can’t seem to get the important bits down. Thanks in advance for any help!

Dear @leighvh

You might want to take a look into: Peirce, J. W., Hirst, R. J. & MacAskill, M. R. (2022). Building Experiments in PsychoPy. 2nd Edn London: Sage. This books provides a structured approach to setting up a PsychoPy-experiment. Reading it will help you effectively plan your experiment. Start simple.

There is one experiment labelled Paired comparison on Pavlovia. There also several experiments on Pavlovia labelled forced choice which might offer a starting point.

Best wishes Jens

I think that the best way of approaching this is to have two routines in a loop.

The first has two sound components (one for each of the pair set from a spreadsheet), but set to start after the routine ends (e.g. with start times of 10 seconds but the routine settings ending the routine after 0.5 seconds – an ITI),

The second would have Each Frame code set to sound_1.play() and sound_2.play() according to a participant response. Actually I might try creating a demo of this with buttons. I’ll post here if I do.

The choice between audio files could end that second routine.

Here’s my demo. I had to make some edits to get the sounds to consistently play online without having to click on the play button twice.

Replay | code | try it

Two audio files are loaded into two sound components during the ITI, but played with zero volume. During the trial routine, buttons are used to play the sound files. Once both audio files have been selected at least once, the trial can be ended with a forced choice. In this demo the pairs are fixed, but independent randomisation could be used if desired.

1 Like

I’ve hit that “sometimes have to click twice to get the audio to play” issue as well – thanks for providing the code to help with that as well! Do you know why that happens, but only happens sometimes? (It’s not a big deal, I’m just curious.)