;ò íy‚Ac @ sŸ d k Z d k l Z d e i f d „ ƒ YZ d „ Z d Z e d j oP d k Z d k Z d k Z e i d e i i e i d ƒ g e i d ƒ n d S( N( s opjs TestPanelc B s, t Z d „ Z d „ Z d „ Z d „ Z RS( Nc C sÈ t i i | | d ƒ | | _ t i | d d d d f ƒ } | i t i | i | ƒ t i | d d d d f ƒ } | i t i | i | ƒ t i | d d d d f ƒ } | i t i | i | ƒ d S( Niÿÿÿÿs Play Sound 1 (sync)i s Play Sound 2 (async)iA s Select .WAV fileii ( s wxs Panels __init__s selfs parents logs Buttons bs Binds EVT_BUTTONs OnButton1s OnButton2s OnSelectSound( s selfs parents logs b( ( se /mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Sound.pys __init__ s c C s{ yI t i t d ƒ ƒ } | i i d ƒ | i t i ƒ | i i d ƒ Wn+ t j o } t i t | ƒ d ƒ n Xd S( Ns data/anykey.wavs before Play... s ...after Play s Exception Message( s wxs Sounds opjs sounds selfs logs writes Plays SOUND_SYNCs NotImplementedErrors vs MessageBoxs str( s selfs evts sounds v( ( se /mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Sound.pys OnButton1 s c C sà y‘ t o t i t d ƒ ƒ } n+ t t d ƒ d ƒ i ƒ } t i | ƒ } | i i d ƒ | i t i ƒ | | _ t i ƒ | i i d ƒ Wn+ t j o } t i t | ƒ d ƒ n Xd S( Ns data/plan.wavs rbs before Play... s ...after Play s Exception Message( s Trues wxs Sounds opjs sounds opens reads datas SoundFromDatas selfs logs writes Plays SOUND_ASYNCs YieldIfNeededs NotImplementedErrors vs MessageBoxs str( s selfs evts sounds datas v( ( se /mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Sound.pys OnButton2! s c C s t i t i | ƒ d d d d t i ƒ} | i ƒ t i j oR y t i i | i ƒ t i ƒ Wq’ t j o } t i t | ƒ d ƒ q’ Xn | i ƒ d S( Ns Choose a sound files wildcards WAV files (*.wav)|*.wavs styles Exception Message( s wxs FileDialogs GetTopLevelParents selfs OPENs dlgs ShowModals ID_OKs Sounds PlaySounds GetPaths SOUND_SYNCs NotImplementedErrors vs MessageBoxs strs Destroy( s selfs evts dlgs v( ( se /mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Sound.pys OnSelectSound3 s ( s __name__s __module__s __init__s OnButton1s OnButton2s OnSelectSound( ( ( se /mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Sound.pys TestPanel s c C s t | | ƒ } | Sd S( N( s TestPanels nbs logs win( s frames nbs logs win( ( se /mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Sound.pys runTestG s sj
This demo offers two examples, both driven by buttons, but obviously the event that drives the playing of the sound can come from anywhere. s __main__s i i ( s wxs Mains opjs Panels TestPanels runTests overviews __name__s syss oss runs mains paths basenames argv( s syss runs overviews runTests wxs oss opjs TestPanel( ( se /mnt/gmirror/ports/x11-toolkits/py-wxPython26-common/work/wxPython-src-2.6.3.3/wxPython/demo/Sound.pys ? s ?