-2

I am trying to get a laughing track to play whenever you die in my text adventure game, I am using Python but since I have no clue how to use Tkinter on Python. I never used TKinter so I need some help. If you are wondering where the file is, It is in a folder I named Sound Files.

Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685

2 Answers2

1

Use winsound - it's built in.

import winsound

winsound.PlaySound('laugh.wav', winsound.SND_FILENAME)
Jonah Fleming
  • 1,187
  • 4
  • 19
  • 31
0

I will wager a guess and say there is not built-in facility for playing audio. I would suggest reviewing older answers to similar question: Play audio with Python

UPDATE

I see I was wrong. Python 3 appears to have some facilities: 22. Multimedia Services — Python 3.5.1 documentation

Community
  • 1
  • 1
wilx
  • 17,697
  • 6
  • 59
  • 114
  • I believe you were right the first time. The 'audio' modules read and write sound files in various formats, but do not play them through a speaker (unless writing to a sound device works). – Terry Jan Reedy Dec 19 '15 at 19:52