How can I make a Python timer that at the end of the timer emits any sound?

Asked

Viewed 38 times

0

import time

def tempo():
    time.sleep(10)    
    print "Ola"

1 answer

2

You can use winsound and specify the sound you want

import winsound
import time

def tempo():
    time.sleep(3.0)
    winsound.PlaySound('C:/Users/usuario/Downloads/sound.wav',winsound.SND_ALIAS)

tempo()
  • Perfect!!! Thank you!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.