From f496594e446be1b70b3e33e85b83e3b74bd4ca8d Mon Sep 17 00:00:00 2001 From: wangjiyu Date: Thu, 10 Apr 2025 12:50:09 +0800 Subject: [PATCH] debug --- util/RTCContext.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/util/RTCContext.cpp b/util/RTCContext.cpp index 77a2763..02e65ac 100644 --- a/util/RTCContext.cpp +++ b/util/RTCContext.cpp @@ -71,6 +71,18 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId, std::cout << "dataCount:" << audioFrame.dataCount << std::endl; std::cout << "dataCount value: " << audioFrame.dataCount << " (max: " << std::numeric_limits::max() << ")" << std::endl; + // 在调用 PyArray_SimpleNew 前插入 + if (!PyArray_API) { + std::cerr << "FATAL: NumPy API not initialized! Addr: " << PyArray_API << std::endl; + abort(); // 立即终止以暴露问题 + } + + std::cout << "step0" << std::endl; + if (!PyArray_SimpleNew) { + std::cerr << "FATAL: PyArray_SimpleNew symbol missing!" << std::endl; + abort(); + } + std::cout << "step0.1" << std::endl; if (!audioFrame.data || audioFrame.dataCount <= 0) { std::cerr << "Invalid audio frame data" << std::endl; PyGILState_Release(gstate);