This commit is contained in:
wangjiyu 2025-04-15 17:30:56 +08:00
parent 00672f25fe
commit 8eb7adb0fd
1 changed files with 2 additions and 8 deletions

View File

@ -101,16 +101,10 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId,
// 增加引用计数防止提前释放 // 增加引用计数防止提前释放
//Py_INCREF(pyCallback_.ptr()); //Py_INCREF(pyCallback_.ptr());
try { try {
/*
std::cout << " pyCallback_ type: " << Py_TYPE(pyCallback_.ptr())->tp_name << std::endl;
PyObject* repr = PyObject_Repr(pyCallback_.ptr());
if (repr) {
std::cout << " pyCallback_ repr: " << PyUnicode_AsUTF8(repr) << std::endl;
Py_DECREF(repr); // 必须手动释放
}
*/
//PyGILState_STATE gstate = PyGILState_Ensure(); //PyGILState_STATE gstate = PyGILState_Ensure();
std::cout << "data:" << audioFrame.data << std::endl;
std::cout << "当前线程是否持有 GIL: " << PyGILState_Check() << std::endl;
np::ndarray audioArray = np::from_data( np::ndarray audioArray = np::from_data(
audioFrame.data, // 数据指针 audioFrame.data, // 数据指针
dtype, // 数据类型 (int16) dtype, // 数据类型 (int16)