Python playing wav audio file code

From , 4 Years ago, written in Python, viewed 51 times.
URL https://pastebin.vip/view/35adf1ae
  1. # play a wave sound on a Windows Box
  2. # Python23 tested   vegaseat   2/8/2005
  3. import winsound
  4. import time
  5. # pick a wave file supplied by Windows XP or one of your own ...
  6. # soundfile = "c:\\Windows\\Media\\chimes.wav"
  7. # Python also accepts the forward slash
  8. soundfile = "c:/Windows/Media/chimes.wav"
  9. winsound.PlaySound(soundfile, winsound.SND_FILENAME|winsound.SND_ASYNC)
  10. # wait one and a half seconds
  11. time.sleep(1.5)
  12. # play the system exit sound if set
  13. winsound.PlaySound("SystemExit", winsound.SND_ALIAS)
  14. #//python/5730

Reply to "Python playing wav audio file code"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website