From: Y.T. on
There's a machine in my lab (aerospace outfit) that is running Linux
and is being used to control a bunch of lab-equipment.

The machine will be replaced with a windows box (Linux isn't allowed
any more for "security reasons". I won't comment on that.)

So I'm porting the software on there. Piece of cake for the Tcl
things ;-) with one exception: Upon certain conditions, the code makes
certain sounds to alert the users of various states (sometimes these
programs have to run with the monitor off, for example, when sensitive
detectors are being tested and there can't be bright lights in the
room). This has worked well, and in Linux I do this simply by "exec
cat $soundfile > /dev/audio" or some such.

I have no idea how I would mimic such a thing in Windows. If I only
needed one sound, I'd use [bell], but there's three distinct occasions
that warrant three different sounds.

I've tried such abominations as
exec {C:\Program Files\Windows Media Player\wmplayer.exe} $soundfile
&
which "kinda sorta" work, but I find wmplayer needs many, many seconds
(ten? twenty?) to start up and "open media" (whatever that may mean).
Which makes it unsuitable for an audible feedback of an error
conditions or such.

(And no, cygwin isn't allowed any more than any other Linux.)

Any ideas?


cordially


Y.T.

--
Remove YourClothes before you email me.
From: Uwe Klein on
Y.T. wrote:
> There's a machine in my lab (aerospace outfit) that is running Linux
> and is being used to control a bunch of lab-equipment.
>
> The machine will be replaced with a windows box (Linux isn't allowed
> any more for "security reasons". I won't comment on that.)
>
Bend over, ...

> So I'm porting the software on there. Piece of cake for the Tcl
> things ;-) with one exception: Upon certain conditions, the code makes
> certain sounds to alert the users of various states (sometimes these
> programs have to run with the monitor off, for example, when sensitive
> detectors are being tested and there can't be bright lights in the
> room). This has worked well, and in Linux I do this simply by "exec
> cat $soundfile > /dev/audio" or some such.
...

> Any ideas?
>
take a snack?
http://wiki.tcl.tk/_//search?S=snack

uwe

From: Prof Craver on
I apologize for not having a Windows solution, but if by any chance
you are allowed to use a MacIntosh in your "secure" installation, OSX
8.5 has the command afplay, e.g. {eval exec afplay pewpewpew.mp3}.

It also has the lovely "say" command that invokes the text-to-speech
engine. Thus you can skip the sound files entirely and write
something like

proc yellAtUser code {
set foo [lindex { "The tcl script is working normally"
"The system is down"
"The cake is a lie" } $code ]

eval exec say [string map {tclsh ticklish tcl tickle}
$foo]
}

--S

[I note that the MacIntosh says "tick-uh-lish", in the face of all
grammar wonks who insist it is supposed to be a two syllable word.]
From: APN on
If you don't mind using extensions, take a look at the beep or
play_sound commands at http://twapi.magicsplat.com/sound.html

/Ashok

On Mar 12, 11:57 pm, "Y.T." <ytyourclot...(a)gmail.com> wrote:
> There's a machine in my lab (aerospace outfit) that is running Linux
> and is being used to control a bunch of lab-equipment.
>
> The machine will be replaced with a windows box (Linux isn't allowed
> any more for "security reasons". I won't comment on that.)
>
> So I'm porting the software on there. Piece of cake for the Tcl
> things ;-) with one exception: Upon certain conditions, the code makes
> certain sounds to alert the users of various states (sometimes these
> programs have to run with the monitor off, for example, when sensitive
> detectors are being tested and there can't be bright lights in the
> room). This has worked well, and in Linux I do this simply by "exec
> cat $soundfile > /dev/audio" or some such.
>
> I have no idea how I would mimic such a thing in Windows. If I only
> needed one sound, I'd use [bell], but there's three distinct occasions
> that warrant three different sounds.
>
> I've tried such abominations as
>   exec {C:\Program Files\Windows Media Player\wmplayer.exe} $soundfile
> &
> which "kinda sorta" work, but I find wmplayer needs many, many seconds
> (ten? twenty?) to start up and "open media" (whatever that may mean).
> Which makes it unsuitable for an audible feedback of an error
> conditions or such.
>
> (And no, cygwin isn't allowed any more than any other Linux.)
>
> Any ideas?
>
> cordially
>
> Y.T.
>
> --
> Remove YourClothes before you email me.