Randomize sound inter-stimuli time

I’m trying to set up an experiment and I can’t quite get it. Maybe you can help me.
It is a succession of videos and polygons, and a “beep” sound must be played in parallel throughout the experiment. This sound should play every 1000ms -1500ms randomly. That is, the time between each “beep” must be random but always between 1000 and 1500ms. I have no problems with the succession of videos and polygons, but I can’t get the sound to work.
What should I do?
Thanks in advance

Start a clock in Begin Experiment.

myClock = core.Clock()

Each Frame check if it has reached a random time and if so, play a sound and reset the clock and the random time interval. I would create the sound as a component in an early routine