How to simultaneously run two routines?

White space is important in Python so you need to do this so we can be sure to read your code properly:

I’ve edited your post above, and if that code was pasted in correctly, then an issue is that you are re-setting the clock on the beginning of every iteration, rather than just at the start of the first iteration (when the sound file itself is played). i.e. with correct indentation, those two operations would be grouped together so that they are both conditional on this being the first iteration, like this:

# only at the beginning of the loop, both start a sound playing and
# start a clock to keep track of its progress:
if trial.thisN == 0:     
    background_sound.play()
    audio_clock = core.Clock()