From f37404204ca173a4917defaf2eb9d63d2822912a Mon Sep 17 00:00:00 2001 From: wangjiyu Date: Thu, 10 Apr 2025 22:08:45 +0800 Subject: [PATCH] debug --- util/RTCContext.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/util/RTCContext.cpp b/util/RTCContext.cpp index 41db2bd..c1df4cb 100644 --- a/util/RTCContext.cpp +++ b/util/RTCContext.cpp @@ -213,10 +213,13 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId, // 5. 构建参数元组 std::cout << "[6] 构建参数元组..." << std::endl; PyObject* py_dims = PyTuple_New(1); + std::cout << "step1, " << py_dims << std::endl; PyTuple_SetItem(py_dims, 0, PyLong_FromLong(dims[0])); + std::cout << "step2" << std::endl; // 修正点:显式处理dtype类型转换 PyArray_Descr* np_dtype = PyArray_DescrFromType(NPY_INT16); + std::cout << "step3" << std::endl; if (!np_dtype) { Py_DECREF(py_dims); Py_DECREF(empty_func); @@ -225,7 +228,9 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId, PyGILState_Release(gstate); throw std::runtime_error("Failed to create numpy dtype"); } + std::cout << "step4" << std::endl; PyObject* dtype = reinterpret_cast(np_dtype); + std::cout << "step5" << std::endl; PyObject* args = PyTuple_Pack(2, py_dims, dtype); std::cout << " 参数构建完成: " << args << std::endl;