I am building a program for Windows PCs that contains a lot of buttons and seems very plain. So I was wondering, can I make it so when you push a button (using tkinter), can I play a sound to liven up the program a bit? Please keep in mind I am learning so please dumb it down a bit.
相关问题
- Can we recover audio from MFCC coefficients?
- Django __str__ returned non-string (type NoneType)
- Is there a way to play audio on a mobile browser w
- How to postpone/defer the evaluation of f-strings?
- ImportError shows up with py.test, but not when ru
You first need to link the click of your mouse on the image, with an even handler, then simply define an on_click function:
Here you can find more information about playing sounds in python.
Assuming your file is a WAV:
Assuming your file is a MP3: