I am trying to offer a way to play audio files from my ruby program (by
running the appropriate application, not actually embedding a player
It’s not really a problem under unix but under windows I would like the app to
automatically use the ‘default’ player for the type of files - is there a
straightforward way to do that?
I am trying to offer a way to play audio files from my ruby program (by
running the appropriate application, not actually embedding a player
It’s not really a problem under unix but under windows I would like the
app to
automatically use the ‘default’ player for the type of files - is there a
straightforward way to do that?
On Win98 there’s a “start” executable that will crank up
the app associated with the file given as a parameter.
Don’t know if it exists in more modern Windowses. But
those do have assoc and ftype or some such… with the
help of those, you might just “execute” the .wav or
whatever as though it were a .exe – but I’m only
guessing.
Hal
···
----- Original Message -----
From: “Nicolas Galler” beanie@gryphonmud.com
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Tuesday, August 19, 2003 12:02 AM
Subject: How to open a file in windows
Suggestions to use “start” are correct but I think they’ll
always launch a DOS console. Besides, the command interpreter
will have to be “command” on win9x/ME but “cmd” on NT/2000/XP.
What you will want is an extension which exposes the ShellExecute
win32 API, if there is such a beast… Otherwise, it should be
possible to wrap it using the Win32API class, given that the
proc signature is the following: