rem: eci.command("cs-set-audio-format " +  format);  eci.command("ao-add " + filename + extension); eci.command("ao-list"); if (eci.last_string_list().size() != 1) { cerr << eci.last_error() << endl; cerr << "---\nError while processing file " << filename + extension << ". Exiting...\n"; break; }
add: if (ecicpp_add_output(&eci, filename + extension, format) < 0) break;
context: int main(int argc, char *argv[]){  COMMAND_LINE cline = COMMAND_LINE (argc, argv);  if (cline.size() < 2) {    print_usage();    return(1);  }  string filename;  ECA_CONTROL_INTERFACE eci;  cline.begin();  cline.next(); // skip the program name    string extension (".raw");  if (cline.end() != true) {    extension = cline.current();    cline.next();  }    while(cline.end() != true) {    filename = cline.current();        cout << "Converting file \"" << filename << "\" --> ";    cout << "\"" << filename + extension << "\"." << endl;        eci.command("cs-add default");    eci.command("c-add default");        eci.command("ai-add " + filename);    eci.command("ai-list");    if (eci.last_string_list().size() != 1) {      cerr << eci.last_error() << endl;      cerr << "---\nError while processing file " << filename << ". Exiting...\n";      break;    }        eci.command("ai-get-format");    string format = eci.last_string();    cout << "Using audio format -f:" << format << "\n";    eci.command("cs-set-audio-format " +  format);        eci.command("ao-add " + filename + extension);    eci.command("ao-list");    if (eci.last_string_list().size() != 1) {      cerr << eci.last_error() << endl;      cerr << "---\nError while processing file " << filename + extension << ". Exiting...\n";      break;    }        eci.command("cs-connect");    eci.command("cs-connected");    if (eci.last_string() != "default") {      cerr << eci.last_error() << endl;      cerr << "---\nError while converting file " << filename << ". Exiting...\n";      break;    }        cout << "Starting processing...\n";        // blocks until processing is done    eci.command("run");        cout << "Processing finished.\n";        eci.command("cs-disconnect");    eci.command("cs-select default");    eci.command("cs-remove");        cline.next();  }  return(0);}