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

Does anyone know if it's possible to play a wav file via cgi.

I would like the ability to play a certain sound on my webserver (apache) when a specific action is performed to alert me when I'm home.

Thanks

Replies are listed 'Best First'.
Re: Playing a wav file in cgi
by grantm (Parson) on Jan 22, 2003 at 02:25 UTC

    Sure, you could just do something like:

    system('/usr/bin/play', '/usr/share/licq/sounds/Monty-Python.wav')

    You might need to do something with the permissions on /dev/dsp though.

Re: Playing a wav file in cgi
by graff (Chancellor) on Jan 22, 2003 at 07:01 UTC
    Do you mean you want the webserver to send a wav file as a stream to your browser at home so that when you hit that cgi script from home, you hear the audio via your browser?

    This would be a matter of setting the Content-type part of the header to "audio/wav" and then just dumping the wav file after that (I think...)