diff --git a/rtc_plugins.cpp b/rtc_plugins.cpp index abddff5..a891209 100644 --- a/rtc_plugins.cpp +++ b/rtc_plugins.cpp @@ -4,6 +4,7 @@ #include "./util/RTCContext.h" +namespace py = boost::python; int init(const char* selfUserId, const char* selfDisplayName, const char* selfRoomId, boost::python::object callback) { RTCContext::instance().setPyCallback(callback); @@ -30,13 +31,14 @@ int initSend(const char* destRoomId, const int16_t destChannelIndex) { return -1; } } -int sendCustomAudioData(const int16_t destChannelIndex, void* customData, int32_t sampleRate, uint64_t channelNum, +int sendCustomAudioData(const int16_t destChannelIndex, py::object pyData, int32_t sampleRate, uint64_t channelNum, uint64_t dataLen) { + PyObject* pyObj = pyData.ptr(); + void* dataPtr = PyArray_DATA((PyArrayObject*)pyObj); return RTCContext::instance().sendCustomAudioData(destChannelIndex, customData, sampleRate, channelNum, dataLen); } BOOST_PYTHON_MODULE(rtc_plugins) { - namespace py = boost::python; py::def("init", &init); py::def("initRecv", &initRecv); py::def("initSend", &initSend);