# Speak programatically in a meeting using windows meeting sdk

**URL:** <https://devforum.zoom.us/t/speak-programatically-in-a-meeting-using-windows-meeting-sdk/89121>\
**Category:** Windows\
**Created:** [May 27, 2023, 7:31am UTC](https://devforum.zoom.us/t/speak-programatically-in-a-meeting-using-windows-meeting-sdk/89121 "2023-05-27T07:31:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![krishnachaithanyatvs](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/krishnachaithanyatvs/32/45969_2.png) [@krishnachaithanyatvs](https://devforum.zoom.us/u/krishnachaithanyatvs)\
**Post date:** [May 27, 2023, 7:31am UTC](https://devforum.zoom.us/t/speak-programatically-in-a-meeting-using-windows-meeting-sdk/89121/1 "2023-05-27T07:31:12Z")

</div>

Hello Dev Team,

We are using Windows sdk C# wrapper and are able to successfully run the demo app, however, we are exploring ways to speak inside a Zoom meeting programmatically.  
We are able to start a meeting and start recording as well.  
Here we require help to find a suitable sample of an SDK API where we can be able to send audio or speak programmatically in the meeting.

Thank You  
Krishna

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [May 29, 2023, 3:33am UTC](https://devforum.zoom.us/t/speak-programatically-in-a-meeting-using-windows-meeting-sdk/89121/2 "2023-05-29T03:33:46Z")

</div>

@krishnachaithanyatvs ,

for this case, you would want to take a look at raw data access, specifically sending raw audio.  
[https://developers.zoom.us/docs/meeting-sdk/windows/raw-data/](https://developers.zoom.us/docs/meeting-sdk/windows/raw-data/)

I’ve a code sample here, it is provided as-is

> **[MSDK\_RawDataDemos/SendAudioRawData at master · tanchunsiong/MSDK\_RawDataDemos](https://github.com/tanchunsiong/MSDK_RawDataDemos/tree/master/SendAudioRawData)**
>
> master/SendAudioRawData

---

<div class="post-metadata">

**Author:** ![krishnachaithanyatvs](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/krishnachaithanyatvs/32/45969_2.png) [@krishnachaithanyatvs](https://devforum.zoom.us/u/krishnachaithanyatvs)\
**Post date:** [May 29, 2023, 5:17am UTC](https://devforum.zoom.us/t/speak-programatically-in-a-meeting-using-windows-meeting-sdk/89121/3 "2023-05-29T05:17:40Z")

</div>

Thank you Chun, i will check your example and update you on the progress.

Thanks Again,  
Krishna

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [June 1, 2023, 6:49am UTC](https://devforum.zoom.us/t/speak-programatically-in-a-meeting-using-windows-meeting-sdk/89121/5 "2023-06-01T06:49:38Z")

</div>

@krishnachaithanyatvs

I’m implementing it slightly differently.

You are using iaudioRawDataReceiverDotNetWrap.send…

I’m reading the buffer from a PCM file from local file system, and sending it.  
I’m also sending it at 44100 instead of 32000

```auto

void PlayAudioFileToVirtualMic(IZoomSDKAudioRawDataSender* audio_sender, string audio_source)
{

	// execute in a thread.
	while (audio_play_flag > 0 && audio_sender) {

		// Check if the file exists
		ifstream file(audio_source, ios::binary | ios::ate);
		if (!file.is_open()) {
			cout << "Error: File not found. Tried to open " << audio_source << endl;
			return;
		}

		// Get the file size
		int file_size = file.tellg();

		// Read the file into a buffer
		vector<char> buffer(file_size);
		file.seekg(0, ios::beg);
		file.read(buffer.data(), file_size);

		// Send the audio data to the virtual camera
		SDKError err = audio_sender->send(buffer.data(), buffer.size(), 44100);
		if (err != SDKERR_SUCCESS) {
			cout << "Error: Failed to send audio data to virtual camera. Error code: " << err << endl;
			return;
		}
		file.close();
		audio_play_flag = -1;
	}

}

```

udioRawData/ZoomSDKVirtualAudioMicEvent.cpp

---

<div class="post-metadata">

**Author:** ![krishnachaithanyatvs](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/krishnachaithanyatvs/32/45969_2.png) [@krishnachaithanyatvs](https://devforum.zoom.us/u/krishnachaithanyatvs)\
**Post date:** [June 1, 2023, 6:55am UTC](https://devforum.zoom.us/t/speak-programatically-in-a-meeting-using-windows-meeting-sdk/89121/6 "2023-06-01T06:55:56Z")

</div>

HI Chun,

I noticed that in your code, but in my use case we should be able to play an audio file or audio stream directly into the meeting, you can assume it is like a bot speaking, where I stream bot audio through the virtual mic.  
Do you think this can be done?

I am using [VB-Audio Virtual Apps](https://vb-audio.com/Cable/) for this case.

Thank You,  
Krishna

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [June 1, 2023, 9:04am UTC](https://devforum.zoom.us/t/speak-programatically-in-a-meeting-using-windows-meeting-sdk/89121/7 "2023-06-01T09:04:42Z")

</div>

@krishnachaithanyatvs ,

If you are using a virtual microphone, it might be even easier to implement. Instead of using raw audio data, you can just get a list of microphone, set the microphone as the virtual device which VB Audio has created, and then join the meeting.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [July 1, 2023, 7:35pm UTC](https://devforum.zoom.us/t/speak-programatically-in-a-meeting-using-windows-meeting-sdk/89121/9 "2023-07-01T19:35:38Z")

</div>

Closed on July 1, 2023, 7:35pm UTC

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