[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Writing to /dev/dsp in Perl



Shlomi Fish <shlomi@slink.co.il> writes:

> 
> At 09:06 AM 7/2/97 -0600, Yaniv Orenstein wrote:
> >Try $ret = open (AUDIO, "|/dev/dsp");
> >
> No, it won't work. When you use the "|..." syntax perl starts an executable
> file and lets you write to its standard output. I.e:
> open(MAIL, '|/usr/sbin/sendmail shlomi@slink.co.il');
> 
> Since /dev/dsp is not an executable but a named character file, it won't
> do. However, the 
> $ret = open (AUDIO, "|cat > /dev/dsp");
> syntax might work, but I may not hear the sound coming till I close the
> AUDIO file handle.
> 
> Maybe I'll do some expereminting on it this evening and let you guys know
> what happen later on. If not, maybe I should post the original message to
> comp.lang.perl.misc or something.
> 
> 	Shlomi Fish
> 
> 

No, it's some crap with the sound driver. You actually have to try
opening it TWICE *8-O . I had the same problem in C.

Try to use some delay after the first (unsuccessful) attempt and try
to open again. 

-- 
-Alexander

==============================================================================
Alexander L. Belikoff			belikoff@bfr.co.il
Berger Financial Research Ltd.
=============================================================================


Follow-Ups: References: