my app plays a couple of sounds. i would like to embed the wav files directly into my app, as i have done with icons.
per suggestion on this list, i am trying resourcepackage. i'm not really familiar with packages, and i find the resourcepackage doc to be thin.
img2py generates a .py file containing my icon, and creates a 'getIcon' method to read it back. this works fine.
i used resourcepackage's 'scan.py' utility to convert my *wav files into *wav.py modules. But i observe there is no special method to read back the encoded .wav file.
in the absence of any special 'getWav' function, i am simply importing the new wav modules. My sound files are stored in 'data' attributes of the *wav.py modules.
wx.Sound() takes a filename arg, or a resource arg, followed by a boolean indicating the arg type.
i assume that my py-encoded wav files should be considered resource files.
wx.Sound plays files, but not the embedded .wav data. Do I need to 'decode' the embedded .wav files somehow? wx.Sound reports
Sound.IsOk(),meaning the load was successful.
I attach wav.py, a small app that plays files successfully, but remains silent when embedded .wav modules are imported and played. I also attach the original .wav files and the generated *wav.py modules
to run wav.py, you need to create a Sound directory and put the wavs and wav.py modules into that directory.
i assume i am either misusing resourcepackage, or i am mishandling wx.Sound(). any thoughts are appreciated.
wav.py (2.24 KB)
EXPLODE.WAV (23 KB)
DRUMROLL_WAV.py (20.5 KB)
DRUMROLL.WAV (19 KB)
EXPLODE_WAV.py (24.8 KB)