I have the video and screenshare working as soon as my bot joins the call, however, I am running into issues with audio - it only seems to work when the unmute button is pressed, is there a way to get the audio to play as soon as the bot joins? When I update the code to allow the bot to join with audio on, it still only seems to play the audio when I mute and then unmute the bot.
I’m not sure if this pop up could be causing the error:
When I close this pop-up I can see the virtual mic is set and it is unmuted:
But the audio will only play on the call, when I hit the microphone to mute it and then press it again to unmute - on this second press the audio plays as expected.
I can see the onMicInitialize is called, but it looks like onMicStartSend only gets triggered when I unmute the bot.
The goal is to get the bot to play the audio as soon as it joins the call.
//these are in the MeetingChatEventListener.cpp
MeetingChatEventListener::MeetingChatEventListener(void(*turnOnSendVideoAndAudio)(), void(*turnOffSendVideoAndAudio)()) {
turnOnSendVideoAndAudio_ = turnOnSendVideoAndAudio;
turnOffSendVideoAndAudio_ = turnOffSendVideoAndAudio;
}
void MeetingChatEventListener::onChatMsgNotifcation(IChatMsgInfo* chatMsg, const zchar_t* content)
{
if (ZCharStringMatches(chatMsg->GetContent(),"turnOn")) {
turnOnSendVideoAndAudio_();
}
else if (ZCharStringMatches(chatMsg->GetContent(), "turnOff")) {
turnOffSendVideoAndAudio_();
}
std::cout<<"onChatMsgNotifcation: " << chatMsg->GetSenderDisplayName() << " says " << chatMsg->GetContent() << endl;
}
//these are in the main class
//set the event handler and pass in method which can be used to call back on the main thread.
m_pMeetingService->GetMeetingChatController()->SetEvent(new MeetingChatEventListener(&turnOnSendVideoAndAudio, &turnOffSendVideoandAudio));
void turnOnSendVideoAndAudio() {
//testing WIP
if (SendVideoRawData) {
IMeetingVideoController* meetingVidController = m_pMeetingService->GetMeetingVideoController();
meetingVidController->UnmuteVideo();
}
//testing WIP
if (SendAudioRawData) {
IMeetingAudioController* meetingAudController = m_pMeetingService->GetMeetingAudioController();
meetingAudController->JoinVoip();
printf("Is my audio muted: %d\n", getMyself()->IsAudioMuted());
//meetingAudController->MuteAudio(getMyself()->GetUserID(),true);
meetingAudController->UnMuteAudio(getMyself()->GetUserID());
//m_pSettingService->GetAudioSettings()->GetMicList();
//m_pSettingService->GetAudioSettings()->UseDefaultSystemMic();
}
}
void turnOffSendVideoandAudio() {
//testing WIP
if (SendVideoRawData) {
IMeetingVideoController* meetingVidController = m_pMeetingService->GetMeetingVideoController();
meetingVidController->MuteVideo();
}
//testing WIP
if (SendAudioRawData) {
IMeetingAudioController* meetingAudController = m_pMeetingService->GetMeetingAudioController();
meetingAudController->MuteAudio(getMyself()->GetUserID(),true);
}
}