Send Raw Audio using Windows Meeting SDK

Description
I have been using the samples from here - GitHub - tanchunsiong/MSDK_RawDataDemos at 50f292d5cc859d9931a084b67fff912a964e7d8f

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 noticed this //TODO comment in the code and was wondering if there is a code snippet that could solve this - https://github.com/tanchunsiong/MSDK_RawDataDemos/blob/50f292d5cc859d9931a084b67fff912a964e7d8f/SendAudioRawData/MSDK_SendAudioRawData.cpp#L61-L78

Thanks,
Chloe

@chloe3 Hope you will be fine. Please DM me I will help you with that. Thanks

1 Like

Thanks @freelancer.nak, I sent you a DM on LinkedIn!

1 Like

I’m not sure if this pop up could be causing the error:

Screenshot 2023-12-06 at 11.08.09

When I close this pop-up I can see the virtual mic is set and it is unmuted:
Screenshot 2023-12-06 at 11.08.31

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.

@chunsiong.zoom have you got any advice on if this is possible or how to solve it?

@chloe3 I don’t have a best practice for this yet, however for testing / sample purposes I unmute my audio when I receive a specific message event.

@chunsiong.zoom thanks for your response, have you got an example of unmuting when you receive a specific message event?

@chloe3

//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);

	}
}


1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.