Re: [ecasound] record with ecasound on a mac

From: Koen <kbr@email-addr-hidden>
Date: Sat Jan 24 2009 - 06:11:14 EET

Hello,

> The ECI interface is a set of bindings for controlling ecasound from
> other programming languages. I've used it before with great success
> with python. I notice that tcl isn't on the list of included
> languages though:
>
> http://ecasound.seul.org/ecasound/Documentation/programmers_guide/html_ecidoc/eci_doc.html
>
> As I'm not a tcl user, we've reached the precipice of my
> usefulness. : )

There are several ways I can think of that would work:

1) a command pipeline:

        set fd [open "|ecasound -c" r+]
        # put EIAM command strings down fd,
        # and get results from fd

   This is how Tkeca [http://tkeca.sf.net/] works...

2) ecasound's daemon mode + TCP connection:

        exec ecasound --daemon --daemon-port=10333
        set chan [socket localhost 10333]
        # put EIAM command strings down chan,
        # and get results from chan

3) make a Tcl-extension in C, which would expose functionality from the ECI
   C-implementation to Tcl. More about this here:
   http://www.omanurkka.net/files/test.c.txt

4) use an Expect interpreter (Tcl based) to communicate with ecasound's
   interactive mode. this might be a cleaner way to talk to the interactive
   program (ecasound -c). See: http://wiki.tcl.tk/201

Since all of above options boil down to sending EIAM commands in the end
(that's the beauty of ECI), you would create some Tcl procs to facilitate
working with EIAM commands. Some things that come to mind: a proc to send an
EIAM command and handles the result, another one that bundles an often-used
sequence of EAIM commands...

It is also adviced to use file event handlers (see http://wiki.tcl.tk/880)
to prevent blocking on gets/puts, and keep your application responsive.

> > all i want to do is to start record and stop a recording at certain
> > points by executing a shell command (which i would execute from
> > tcl---there is apparently no way to record a sound on a current mac
> > *within* tcl/tk, the only package, "snack", doesn't seem to work
> > with mac and recent operating systems---that's when someone in the
> > tcl community recommended ecasound to me.)

Tcl is a good choice for work like this, as it was made exactly for that ;)

One of the above choices plus a handful of lines more should give you a
rudimentary Tcl application that does what you need.

greetz,
  koen.

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Ecasound-list mailing list
Ecasound-list@email-addr-hidden
https://lists.sourceforge.net/lists/listinfo/ecasound-list
Received on Sat Jan 24 08:15:02 2009

This archive was generated by hypermail 2.1.8 : Sat Jan 24 2009 - 08:15:02 EET