This commit is contained in:
wangjiyu 2025-04-15 17:20:33 +08:00
parent 2fd9f33a68
commit aced2e2308
1 changed files with 3 additions and 2 deletions

View File

@ -69,7 +69,7 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId,
std::cerr << "Python 解释器未初始化!" << std::endl;
return;
}
//PyGILState_STATE gstate = PyGILState_Ensure();
PyGILState_STATE gstate = PyGILState_Ensure();
namespace py = boost::python;
try {
@ -108,6 +108,7 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId,
}
*/
//PyGILState_STATE gstate = PyGILState_Ensure();
np::ndarray audioArray = np::from_data(
audioFrame.data, // 数据指针
dtype, // 数据类型 (int16)
@ -124,7 +125,7 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId,
audioFrame.numChannels,
audioFrame.channelIndex
);
PyGILState_Release(gstate);
//PyGILState_Release(gstate);
std::cout << " after callback" << std::endl;
if (PyErr_Occurred()) {
PyObject *type, *value, *traceback;