The question is similar to Automatically play sound in IPython notebook - the diffrence is I need to play the sound several times. At the browser side - not the server.
The most naive approach:
IPython.display.Audio(url="http://www.w3schools.com/html/horse.ogg", autoplay=True)
time.sleep(10)
IPython.display.Audio(url="http://www.w3schools.com/html/horse.ogg", autoplay=True)
does not work as it plays the sound once. Moreover, it seems that it is necessary for IPython.display.Audio
object to be the output of the cell, as:
IPython.display.Audio(url="http://www.w3schools.com/html/horse.ogg", autoplay=True)
None
plays no sound.
Splitting the code into several cells is not an option.