1. anatoly techtonik
  2. audiosocket

Commits

anatoly techtonik  committed 8fd3b3f

bugfix: add AudioWriter.close() method for closing output device

  • Participants
  • Parent commits aabdb89
  • Branches default

Comments (0)

Files changed (1)

File audiosocket.py

View file
  • Ignore whitespace
         sys.exit('Error: waveOutUnprepareHeader failed with code 0x%x' % ret)
       break
 
+  def close(self):
+    """ x. Close Sound Device """
+    winmm.waveOutClose(self.hwaveout)
+    print "Default Wave Audio output device is closed"
+
 
 aw = AudioWriter()
 
   aw.play(data)
 df.close()
 
-# x. Close Sound Device
-
-winmm.waveOutClose(hwaveout)
-print "Default Wave Audio output device is closed"
+aw.close()
 
 #-- /CHAPTER 1 --