Mercurial > hg > vampy-host
comparison vampyhost.cpp @ 11:e5b575d69b01 lf-numpy-arrays
changed a comment
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Wed, 20 Mar 2013 11:07:24 +0000 |
parents | 8306b7fdd2d0 |
children |
comparison
equal
deleted
inserted
replaced
10:8306b7fdd2d0 | 11:e5b575d69b01 |
---|---|
544 cout << "Plugin Maker" << plugin->getMaker() << endl; | 544 cout << "Plugin Maker" << plugin->getMaker() << endl; |
545 | 545 |
546 float **inbuf = new float *[channels]; | 546 float **inbuf = new float *[channels]; |
547 cout << "Created inbuf with #channels: " << channels << endl; | 547 cout << "Created inbuf with #channels: " << channels << endl; |
548 | 548 |
549 | |
550 | |
549 for (int c = 0; c < channels; ++c) { | 551 for (int c = 0; c < channels; ++c) { |
550 | 552 |
551 // cout << "[Host] Converting channel #" << c << endl; | 553 // cout << "[Host] Converting channel #" << c << endl; |
552 // PyObject *cbuf = PyList_GET_ITEM(pyBuffer, c); | 554 // PyObject *cbuf = PyList_GET_ITEM(pyBuffer, c); |
553 // cout << "Ok1..." << endl; | 555 // cout << "Ok1..." << endl; |
554 // inbuf[c] = pyArrayToFloatArray(cbuf); | 556 // inbuf[c] = pyArrayToFloatArray(cbuf); |
555 | 557 |
556 inbuf[c] = pyArrayToFloatArray((PyObject*) pyBuffer); | 558 inbuf[c] = pyArrayToFloatArray((PyObject*) pyBuffer); |
557 | 559 |
558 cout << "Ok2..." << endl; | 560 cout << "Converted " << endl; |
559 | 561 |
560 if (!inbuf[c]) { | 562 if (!inbuf[c]) { |
561 PyErr_SetString(PyExc_TypeError,"NumPy Array required for each channel in process input."); | 563 PyErr_SetString(PyExc_TypeError,"NumPy Array required for each channel in process input."); |
562 return NULL; | 564 return NULL; |
563 } | 565 } |