From: Robin Dunn Date: Fri, 29 Oct 2004 16:50:07 +0000 (+0000) Subject: Save a reference to the async sound object X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/75a937411ce0aa5856b135f2d0f9406ac83e9cce?ds=inline Save a reference to the async sound object git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30164 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/demo/Sound.py b/wxPython/demo/Sound.py index de0e5b948e..2584de414c 100644 --- a/wxPython/demo/Sound.py +++ b/wxPython/demo/Sound.py @@ -41,6 +41,7 @@ class TestPanel(wx.Panel): self.log.write("before Play...\n") sound.Play(wx.SOUND_ASYNC) + self.sound = sound # save a reference (This shoudln't be needed, but there seems to be a bug...) wx.YieldIfNeeded() self.log.write("...after Play\n") except NotImplementedError, v: @@ -54,11 +55,11 @@ class TestPanel(wx.Panel): style=wx.OPEN) if dlg.ShowModal() == wx.ID_OK: try: - #sound = wx.Sound(dlg.GetPath()) + #sound = wx.Sound(dlg.GetPath(), wx.SOUND_SYNC) #sound.Play() # another way to do it. - wx.Sound.PlaySound(dlg.GetPath()) + wx.Sound.PlaySound(dlg.GetPath(), wx.SOUND_SYNC) except NotImplementedError, v: wx.MessageBox(str(v), "Exception Message")