[wxPython] Portably playing sound files (possibly OT)

Hi,

Relatively new user of both Python and wxPython, and am enjoying both so far.

Currently am going insane because I can't find out an OS-portable method of
playing a sound file. Have searched through both the Python and wxWindows
docs to no avail (well, the python docs do mention an UNDOCUMENTED audiodev
module, and looking at the audiodev.py source gives a good clue as to why
it's undocumented) [0]. There's also the Windows-specific winsound module,
but of course that's not portable.

I'm justifying my posting of this question on an obviously GUI-specific
Python list because... um.... surely most gui programmers feel the need to
make noises occasionally :)? <click button> Beep! [1]

Well all right, it's also because there appear to be quite a few
knowledgeable people on this list that might know an answer.

I can see that you could use a platform check, using the winsound module on
Windows and spawning a shell to run 'play' or suchlike on Unix... but
that'd be _such_ a kludge. *sigh*

Any suggestions/pointers/recommendations would be greatly appreciated.

Pete.

[0] It doesn't appear to make any sense. Well all right, not to me anyway.

[1] If you _really_ feel the need to flame me for this being OT, do it in
private email, not to the list. Thank you. :slight_smile:

···

--
http://cygnus.uwa.edu.au/~pete/

--
BEDEVERE: Wait. Wait ... tell me, what also floats on water?
ALL: Bread? No, no, no. Apples .... gravy ... very small rocks ...
ARTHUR: A duck.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

Currently am going insane because I can't find out an OS-portable method

of

playing a sound file. Have searched through both the Python and wxWindows
docs to no avail (well, the python docs do mention an UNDOCUMENTED

audiodev

module, and looking at the audiodev.py source gives a good clue as to why
it's undocumented) [0]. There's also the Windows-specific winsound module,
but of course that's not portable.

wxWindows has the wxWave class, but I havn't gotten it into wxPython yet.
It's on the list now so maybe it will be done for the next release. It will
be simple to add it to wxPython, but I'll also have to tweak the build
script a bit so it can be disabled on platforms where it's not supported.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

There is wxWave in wxWindows, but it hasn't been added to wxPython (yet?).
The only things I've found for Python were the PythonWare Sound Toolkit,
whicih works for win32 and Solaris, not sure about Linux etc., and then there
is Snack, but requires tcl.

  Rob Cakebread

PythonWare Sound Toolkit: http://www.pythonware.com/products/pst/
Snack: Snack Home Page

···

On Friday 09 March 2001 10:29 am, you wrote:

Currently am going insane because I can't find out an OS-portable method of
playing a sound file. Have searched through both the Python and wxWindows
docs to no avail (well, the python docs do mention an UNDOCUMENTED audiodev
module, and looking at the audiodev.py source gives a good clue as to why
it's undocumented) [0]. There's also the Windows-specific winsound module,
but of course that's not portable.

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

[ I originally wrote: ]

> Currently am going insane because I can't find out an OS-portable
> method of playing a sound file.

[ ... ]

wxWindows has the wxWave class, but I havn't gotten it into wxPython yet.

Ahhh... that sounds interesting, no pun intended.

I did actually think at some point that it seemed strange wxWindows didn't
have some facility for simple sound output. Hmmm *scans wxWindows docs
again* Ahhh, there it is - in the wxWindows docs it's listed under
"Alphabetical class reference", but is not listed under "Classes by
category"... and I was only looking under the second of course *roll of
eyes*.

It's on the list now so maybe it will be done for the next release. It
will be simple to add it to wxPython, but I'll also have to tweak the
build script a bit so it can be disabled on platforms where it's not
supported.

Cue assorted cheering noises.

Robin Dunn

There is wxWave in wxWindows, but it hasn't been added to wxPython
(yet?).

Thanks to Brave Sir Robin above, perhaps the next release... :slight_smile:

The only things I've found for Python were the PythonWare Sound Toolkit,
whicih works for win32 and Solaris, not sure about Linux etc., and then
there is Snack, but requires tcl.

[ snip links ]

I'll have a look at the PythonWare sound toolkit, thank you for the link.

  Rob Cakebread

Again, thanks to both Rob and Robin.

Pete.

···

On Fri, Mar 09, 2001 at 11:04:14AM -0800, Robin Dunn wrote:
On Fri, Mar 09, 2001 at 11:05:25AM -0800, Rob Cakebread wrote:
--
http://cygnus.uwa.edu.au/~pete/

--
ALL: A witch! A witch!
WITCH: It's a fair cop.
ALL: Burn her! Burn her! Let's make her into a ladder.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

Robin Dunn wrote:

wxWindows has the wxWave class, but I havn't gotten it into wxPython yet.
It's on the list now so maybe it will be done for the next release. It will
be simple to add it to wxPython, but I'll also have to tweak the build
script a bit so it can be disabled on platforms where it's not supported.

If you're swayed by user's interest, then let me add my weight to the
request for the inclusion of wxWave. Within a month or two, a platform
independent way or producing sounds will become important to me.

Thanks very much,
Gary.

···

--
Dr. Gary Herron <gherron@aw.sgi.com>
206-287-5616
Alias | Wavefront
1218 3rd Ave, Suite 800, Seattle WA 98101

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users