This commit is contained in:
wangjiyu 2025-04-10 21:10:35 +08:00
parent ba09525535
commit 59a0dde8ab
1 changed files with 7 additions and 7 deletions

View File

@ -74,9 +74,9 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId,
void** numpyApi = numpyApi_;
if (!numpyApi || !numpyApi[93]) { // 93是PyArray_SimpleNew的偏移量
std::cout << "NumPy API corrupt! Key functions missing." << std::endl;
std::cout << "numpyApi is null in onAudioProcess" << std::endl;
} else {
std::cout << "PyArray_API is not null in init" << std::endl;
std::cout << "numpyApi is not null in onAudioProcess" << std::endl;
}
//auto numpyApi = RTCContext::numpy_api();
std::cout << "step1" << std::endl;
@ -88,7 +88,7 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId,
using PyArray_SimpleNew_t = PyObject*(*)(int, npy_intp*, int);
std::cout << "step3" << std::endl;
auto PyArray_SimpleNew = reinterpret_cast<PyArray_SimpleNew_t>(numpyApi[93]);
std::cout << "step4" << std::endl;
std::cout << "step4" << PyArray_SimpleNew << std::endl;
// 3. 严格校验输入数据
if (!audioFrame.data || audioFrame.dataCount <= 0) {
@ -166,9 +166,9 @@ bool RTCContext::init(const char* selfUserId, const char* selfDisplayName, const
{
void** numpyApi = numpyApi_;
if (!numpyApi || !numpyApi[93]) { // 93是PyArray_SimpleNew的偏移量
std::cout << "NumPy API corrupt! Key functions missing." << std::endl;
std::cout << "numpyApi is null in init" << std::endl;
} else {
std::cout << "PyArray_API is not null in init" << std::endl;
std::cout << "numpyApi is not null in init" << std::endl;
}
mrtc::IMRTCEngineFactory * rtcFactory = mrtc::getMRTCEngineFactory();
if (!rtcFactory)
@ -222,9 +222,9 @@ bool RTCContext::initRecv(const char* destRoomId, const char* srcUserId, const i
{
void** numpyApi = numpyApi_;
if (!numpyApi || !numpyApi[93]) { // 93是PyArray_SimpleNew的偏移量
std::cout << "NumPy API corrupt! Key functions missing." << std::endl;
std::cout << "numpyApi is null in initRecv" << std::endl;
} else {
std::cout << "PyArray_API is not null in init" << std::endl;
std::cout << "numpyApi is not null in initRecv" << std::endl;
}
while (!isOnConsumer_)
{