Reputation: 37
I want to play a sound in python but I don't want to use external libaries like pygame and I don't want the windows media player to show up.
Its not that I can't pip install things but other people who will be using this program won't know how to pip install python libaries.
winsound.PlaySound(r"C:\Temp\Soundboard\s1.mp3", winsound.SND_FILENAME)
^^^ That just plays a windows sound.
os.system("start C:\Temp\Soundboard\s1.mp3")
^^^ And that makes windows media player pop up to play the sound.
Any help will be greatly appreciated
Upvotes: 1
Views: 897
Reputation: 2981
winsound
will work fine, as long as the files are wav
files. To play other files, I'd recommend using the vlc.py. Just include the entire file (or you can attempt to separate the parts that you don't need), found here, in your own file to use the relevant functions.
Upvotes: 1