[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Writing to /dev/dsp in Perl
Alexander L. Belikoff writes:
> 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
<snip>
> > 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.
<snip>
>
> 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.
I believe this is only the case when the sound driver is loaded as a
module. The first attempt to open the file causes the module to get
loaded, but fails. The second attempt succeeds because the module is
already loaded. So, this would only be the problem if the sound
driver is compiled as a module. If it's compiled into the kernel then
it shouldn't be a problem.
--
Harvey J. Stein
Berger Financial Research
abel@netvision.net.il
References: