On Wed, Apr 6, 2022 at 12:17 AM Ben Gorte <[email protected]> wrote:
> > One of the more obvious approaches has J feeding the wav
> > file to a program on a pipe.

Yes, that works, though it has limitations.

In particular, you have to write a fresh file and start up a new
instance of the sound playing program whenever you want to play a
different sound.

Whether that is significant or not depends on context (and on the
goals of the programmer).

> > After a bit of investigation, I found that
> > https://code.jsoftware.com/wiki/System/ReleaseNotes/J903 states:
> >
> > "Old foreigns 2!:2 and 2!:3 are removed from the language"
>
> Wait a minute, you don't need 2!:2 to feed things through a pipe into
> another program, do you?
>
> IIRC, when running a script in jconsole and writing things to stdout using
> echo (or smoutput or even stdout), this can be redirected and "piped" as
> usual in Linux (which is what Patrick is using).

Yes, that works, though it has limitations.

In particular, this would mean that you could not use J interactively
(unless, perhaps, you were working with a modified version of JHS --
modified, to prevent the usual startup message).

> Furthermore, fwrite goes into a "named pipe" when a fifo with that name
> exists (and some other program reads from it).

That's an intriguing idea. I wonder if we could come up with working
examples on each major OS?

Thanks,

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to