This commit is contained in:
wangjiyu 2025-04-15 23:21:48 +08:00
parent 6936dfd292
commit 715687e85c
3 changed files with 6 additions and 4 deletions

View File

@ -39,8 +39,8 @@ int initRecv(const char* destRoomId, const char* srcUserId, const int16_t destCh
return -1;
}
}
int initSend(const char* srcRoomId, const char* destRoomId, const int16_t destChannelIndex) {
bool res = RTCContext::instance().initSend(srcRoomId, destRoomId, destChannelIndex);
int initSend(const char* srcRoomId, const char* destRoomId, const int16_t destChannelIndex, const int16_t channelNum) {
bool res = RTCContext::instance().initSend(srcRoomId, destRoomId, destChannelIndex, channelNum);
if (res) {
return 0;
} else {

View File

@ -561,7 +561,8 @@ bool RTCContext::initRecv(const char* destRoomId, const char* srcUserId, const i
return true;
}
bool RTCContext::initSend(const char* srcRoomId, const char* destRoomId, const int16_t destChannelIndex)
bool RTCContext::initSend(const char* srcRoomId, const char* destRoomId, const int16_t destChannelIndex,
const uint8_t channelNum)
{
while (!isOnRoom_)
{
@ -586,6 +587,7 @@ bool RTCContext::initSend(const char* srcRoomId, const char* destRoomId, const i
strcpy(option.dstRoomId, destRoomId);
}
option.channelIndex = destChannelIndex;
option.channel = channelNum;
std::cout << "startCustomAudio" << std::endl;
int16_t ret2 = rtcEngine_->startCustomAudio(option);
if (ret2 != 0)

View File

@ -84,7 +84,7 @@ public:
mrtc::IMRTCEngine* getRtcEngine() const;
bool init(const char* selfUserId, const char* selfDisplayName, const char* selfRoomId);
bool initRecv(const char* destRoomId, const char* srcUserId, const int16_t destChannelIndex);
bool initSend(const char* srcRoomId, const char* destRoomId, const int16_t destChannelIndex);
bool initSend(const char* srcRoomId, const char* destRoomId, const int16_t destChannelIndex, const uint8_t channelNum);
void* getpData() const;
void setpData(void* pData);