This commit is contained in:
wangjiyu 2025-04-10 12:50:09 +08:00
parent 9d0ed138ff
commit f496594e44
1 changed files with 12 additions and 0 deletions

View File

@ -71,6 +71,18 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId,
std::cout << "dataCount:" << audioFrame.dataCount << std::endl; std::cout << "dataCount:" << audioFrame.dataCount << std::endl;
std::cout << "dataCount value: " << audioFrame.dataCount std::cout << "dataCount value: " << audioFrame.dataCount
<< " (max: " << std::numeric_limits<npy_intp>::max() << ")" << std::endl; << " (max: " << std::numeric_limits<npy_intp>::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) { if (!audioFrame.data || audioFrame.dataCount <= 0) {
std::cerr << "Invalid audio frame data" << std::endl; std::cerr << "Invalid audio frame data" << std::endl;
PyGILState_Release(gstate); PyGILState_Release(gstate);