[ecasound] Multitrack Recording via Control Interface

From: Markus Luttenberger <m.luttenberger@email-addr-hidden>
Date: Wed Aug 12 2009 - 16:00:36 EEST

Hello!

I recently discovered Ecasound as a handy tool for my problem. I need to
record sound (voice only) from different sound cards on one computer.
This command line does the job:

ecasound -a:1 -i alsahw,1,0 -o ./test1.wav -a:2 -i alsahw,2,0 -o ./test2.wav

Now I wanted to develop a small C++ user interface around it but my
commands don't work. Either the program does nothing or it hangs. This
is what I've got so far:

>>>>> SNIP >>>>>

...
int sources = 3; // user input
...

//--------------------------------------------------------------------------
// construct ECA control interface and configure it for recording
ECA_CONTROL_INTERFACE e;
const string current_time(getCurrentTime());

e.command("cs-add recording_chainsetup");

for (int count = 1; count <= sources; count++)
{
     const char source_no = '0' + count;
     // the command chain
     e.command("c-add " + source_no);
     // the HW input source
     e.command("ai-add alsahw," + source_no + ',' + '0');
     // output file name
     e.command("ao-add ./" + current_time + "-s" + source_no + ".wav");
}

//e.command("c-select all"); // -> program hangs when enabled
e.command("c-list");
e.command("c-status");
e.command("cs-connect");
e.command("start");
cout << "Starting recording...\n";

while (1)
{
     sleep(1);
     e.command("engine-status");
     if (e.last_string() != "running")
         break;
}

e.command("stop");
e.command("cs-disconnect");
e.command("cop-status");
cerr << "Chain operator status: " << e.last_string() << endl;
cout << "Error: " << e.last_error() << endl;

<<<<< SNAP <<<<<

This code follows the example as found in the Ecasound Control Interface
Guide. I don't know if I need the chain setup "recording_chainsetup"
because I don't needed it in the command line. Some commands seem to
have no effect at all?! (e.g. "c-list", "c-status")

This is my output:

>>>>> SNIP >>>>>

***********************************************************************
* Message from libecasoundc:
*
* 'ECASOUND' environment variable not set. Using the default value
* value 'ECASOUND=ecasound'.
***********************************************************************

Starting recording...
Chain operator status: ### Chain operator status (chainsetup
'recording_chainsetup') ###

Error:

<<<<< SNAP <<<<<

So, what am I doing wrong?

Also, on a side note, how serious will be the synchronisation issue
between these recordings? I've read that the speed can alternate due
latency and slightly different sampling rates.

greetings..
..Markus

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Ecasound-list mailing list
Ecasound-list@email-addr-hidden
https://lists.sourceforge.net/lists/listinfo/ecasound-list
Received on Thu Aug 13 00:15:01 2009

This archive was generated by hypermail 2.1.8 : Thu Aug 13 2009 - 00:15:02 EEST