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.
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
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;
}
}
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?
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.