From 5398231044e47f361148b028cf2cad91a5a4b256 Mon Sep 17 00:00:00 2001 From: wangjiyu Date: Thu, 10 Apr 2025 09:50:05 +0800 Subject: [PATCH] debug --- rtc_plugins.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rtc_plugins.cpp b/rtc_plugins.cpp index 92d4546..14c700a 100644 --- a/rtc_plugins.cpp +++ b/rtc_plugins.cpp @@ -43,6 +43,11 @@ int sendCustomAudioData(const int16_t destChannelIndex, py::object pyData, int32 std::cout << "step 2" << std::endl; std::cout << "pyData ptr is:" << pyData.ptr() << std::endl; // 2. 检查是否是 numpy 数组 + if (!PyObject_Check(pyData.ptr())) { + std::cerr << "ERROR: Not a valid Python object" << std::endl; + throw std::runtime_error("Invalid Python object"); + } + std::cout << "step 2.1" << std::endl; if (!PyArray_Check(pyData.ptr())) { std::cout << "input is notnumpy" << std::endl; throw std::runtime_error("Input is not a numpy array");