Separate Spreadsheet Within Routine

Hello there!

My OS is MacOS Monterey version 12.6.5 and I have PsychoPy version 2020.2.10.

I am trying to build a target detection task wherein I show participants a stream of sound stimuli and they are asked to press the spacebar when they hear a certain target. I have 36 streams with 72 syllables each, wherein the target syllable appears 4 times within each stream. Right now, my spreadsheet is set up so that I have a column called “Stream” where I have numbers 1-36 (72 of each number, beside each syllable). I also have “Audio” where I specify the WAV path file so that PsychoPy can play it as needed. Currently, when I run the experiment, it plays all 36 streams without stopping. I would like it to play one stream and then pause, so that it can move onto other routines. I assume that I need to add a code component, so this is what I have so far:

 if stream == '1':  # only play for the first stream
    TDSyllableStreams.sound = True
else:
    # don't play anything
    TDSyllableStreams.sound = None

I am an extreme beginner at PsychoPy and Python in general, so any help would be appreciated. Thank you so much!