This commit is contained in:
wangjiyu 2025-05-04 10:58:59 +08:00
parent 7ed30e6edc
commit e70e728b98
2 changed files with 4 additions and 6 deletions

View File

@ -5,7 +5,7 @@
namespace py = pybind11;
#include "util/RTCContext.h"
int init(const char* selfUserId, const char* selfDisplayName, const char* selfRoomId, py::object callback) {
int init(const char* selfUserId, const char* selfDisplayName, const char* selfRoomId) {
bool res = RTCContext::instance().init(selfUserId, selfDisplayName, selfRoomId);
if (res) {
return 0;

View File

@ -13,11 +13,8 @@ srcRoomId = "srcRoom12"
destRoomId = srcRoomId
srcChannelIndex = 46
destChannelIndex = 47
def my_callback(shmName, dataSize, dataCount, sampleRate, numChannels, channelIndex):
print(f"my_callback, dataSize:{dataSize}, dataCount:{dataCount}, sampleRate:{sampleRate}, numChannels:{numChannels}, channelIndex:{channelIndex}")
print(f"data:{shmName}")
print("after my_callback_r")
ret = rtc_plugins.init(srcUserId, srcDisplayName, srcRoomId, my_callback)
ret = rtc_plugins.init(srcUserId, srcDisplayName, srcRoomId)
if ret != 0:
print(f"init fail, ret:{ret}")
exit(1)
@ -35,6 +32,7 @@ if audioData.dtype != np.int16:
ret = rtc_plugins.sendCustomAudioData(destChannelIndex, audioData, sampleRate, 1, len(audioData))
if ret != 0:
print(f"send fail, ret:{ret}")
print("send succ")
#ret = rtc_plugins.initRecv(srcRoomId, srcUserId, srcChannelIndex)
#if ret != 0:
# print(f"initRecv fail, ret:{ret}")