debug
This commit is contained in:
parent
ab19010a9e
commit
a098a6a825
|
@ -103,21 +103,21 @@ int sendCustomAudioData(const int16_t destChannelIndex, py::object pD, int32_t s
|
|||
return -1;
|
||||
}
|
||||
}
|
||||
void init_numpy() {
|
||||
|
||||
// 修改后的初始化函数
|
||||
int init_numpy() {
|
||||
if (import_array() < 0) {
|
||||
throw std::runtime_error("NumPy initialization failed");
|
||||
PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOST_PYTHON_MODULE(rtc_plugins) {
|
||||
try {
|
||||
init_numpy();
|
||||
// 注册函数...
|
||||
if (init_numpy() != 0) return;
|
||||
|
||||
py::def("init", &init);
|
||||
py::def("initRecv", &initRecv);
|
||||
py::def("initSend", &initSend);
|
||||
py::def("sendCustomAudioData", &sendCustomAudioData);
|
||||
} catch (...) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "Module initialization failed");
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue