]> git.saurik.com Git - wxWidgets.git/commitdiff
Some test code for loading sound from data
authorRobin Dunn <robin@alldunn.com>
Fri, 7 May 2004 21:43:35 +0000 (21:43 +0000)
committerRobin Dunn <robin@alldunn.com>
Fri, 7 May 2004 21:43:35 +0000 (21:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27148 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/demo/Sound.py

index 456733b5bfbbe2278e06192f224c505774b87dc2..c6d7028edb47f2a9d7c68969a6e9b38a6dcb7744 100644 (file)
@@ -32,7 +32,9 @@ class TestPanel(wx.Panel):
 
     def OnButton2(self, evt):
         try:
-            sound = wx.Sound(opj('data/plan.wav'))
+            #sound = wx.Sound(opj('data/plan.wav'))
+            data = open(opj('data/plan.wav'), 'rb').read()
+            sound = wx.SoundFromData(data)            
             self.log.write("before Play...\n")
             sound.Play(wx.SOUND_ASYNC)
             wx.YieldIfNeeded()