palkia has asked for the wisdom of the Perl Monks concerning the following question:

hello

I tried to play a wav file with
system('start','','C:\WINDOWS\Media\tada.wav');
but it played it in my windows media player as default like it would if I just double-clicked the file.

what I'm trying to do is to play it without opening any media player,
like windows itself does with wav files when they are used automatically when an event occurs like:
connecting/disconnecting a usb device,starting/ending, windows, receiving alert, etc...

So I figured those cases are when windows itself plays the wav file so I tried:
system('start','win','C:\WINDOWS\Media\tada.wav');
which did nothing.
and
system('start','win32','C:\WINDOWS\Media\tada.wav');
which got an error (something about windows was unable to find win32, same for anything I tried in its place (including 'windows'))

So.. yeah I got nothing.
Is there a simple way to do this ?
Most preferable without depending on modules.

Thx

Replies are listed 'Best First'.
Re: how to play wav files without calling any media player ?
by Corion (Patriarch) on Jun 05, 2011 at 19:07 UTC
      IIRC there is a /hide switch that you can use. Google around / look for it. Or, as the other monk suggested, use a module!
        couldn't find anything (maybe because I can't google a '/').
        could you please be more specific ? Not completely sure what key words I'm looking for too (being a perl noob ^^).

        (regardless: thank you both)