# Meeting SDK, sending raw audio data impacted by sampling rates and duration

**URL:** <https://devforum.zoom.us/t/meeting-sdk-sending-raw-audio-data-impacted-by-sampling-rates-and-duration/116705>\
**Category:** Meeting SDK\
**Created:** [August 31, 2024, 9:01am UTC](https://devforum.zoom.us/t/meeting-sdk-sending-raw-audio-data-impacted-by-sampling-rates-and-duration/116705 "2024-08-31T09:01:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pankn](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/pankn/32/49230_2.png) [@pankn](https://devforum.zoom.us/u/pankn)\
**Post date:** [August 31, 2024, 9:01am UTC](https://devforum.zoom.us/t/meeting-sdk-sending-raw-audio-data-impacted-by-sampling-rates-and-duration/116705/1 "2024-08-31T09:01:51Z")

</div>

Hello @chunsiong.zoom,  
I am working with the code from [meetingsdk-linux-raw-recording-sample/demo at main · zoom/meetingsdk-linux-raw-recording-sample · GitHub](https://github.com/zoom/meetingsdk-linux-raw-recording-sample/tree/main/demo) and am trying to send audio in a loop (demo/ZoomSDKVirtualAudioMicEvent.cpp) i.e. play the same wav file again and again once for each iteration. The issue I am seeing is that:

- For longer samples (~ \>= 10s) things seem to be OK but for shorter samples e.g. 5s or smaller the first iteration plays fine but subsequent iterations speed up the speech (as if speaking faster). Also I think lesser sampled pieces have more issues i.e. 16000 Hz sample plays worse than 32000 and upwards.  
Need help here on why is this happening !  
I have audio samples that can help you check this on your side. Please find them at [GitHub - pankajidwallet/audio\_samples: audio\_samples to help debug the wav issue](https://github.com/pankajidwallet/audio_samples.git)

---

<div class="post-metadata">

**Author:** ![amanda-recallai](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/amanda-recallai/32/44747_2.png) [@amanda-recallai](https://devforum.zoom.us/u/amanda-recallai)\
**Post date:** [August 31, 2024, 6:28pm UTC](https://devforum.zoom.us/t/meeting-sdk-sending-raw-audio-data-impacted-by-sampling-rates-and-duration/116705/2 "2024-08-31T18:28:34Z")

</div>

@pankn,

Although I’m not sure why the audio loop is not working for the linux raw recording sample, if you’re open to using an API, you could use [this meeting bot API](https://docs.recall.ai/docs/stream-media?utm_source=zoom_dev_forum&utm_medium=forum_answer&utm_campaign=meeting-sdk-sending-raw-audio-data-impacted-by-sampling-rates-and-duration&utm_content=Recall.ai) that shows you how to output audio/video in the bot instead.

Let me know if you have any questions!

---

<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:** [September 2, 2024, 3:26am UTC](https://devforum.zoom.us/t/meeting-sdk-sending-raw-audio-data-impacted-by-sampling-rates-and-duration/116705/3 "2024-09-02T03:26:03Z")

</div>

@pankn you will need to set the sampling rate

> [@Meeting SDK Sending Audio raw data](https://devforum.zoom.us/t/meeting-sdk-sending-audio-raw-data/100571/2):
>
> @stutberidze there are 3 things to take note when sending raw audio. You might need to call the method below, which unmutes the microphone void turnOnSendVideoAndAudio() { //testing WIP if (SendVideoRawData) { IMeetingVideoController\* meetingVidController = m\_pMeetingService-\>GetMeetingVideoController(); meetingVidController-\>UnmuteVideo(); } //testing WIP if (SendAudioRawData) { IMeetingAudioController\* meetingAudController = m\_pMeetingService-\>GetMeetingAudioController(); meeti…

---

<div class="post-metadata">

**Author:** ![pankn](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/pankn/32/49230_2.png) [@pankn](https://devforum.zoom.us/u/pankn)\
**Post date:** [September 2, 2024, 6:12am UTC](https://devforum.zoom.us/t/meeting-sdk-sending-raw-audio-data-impacted-by-sampling-rates-and-duration/116705/4 "2024-09-02T06:12:40Z")

</div>

@chunsiong.zoom I have already done that, used the correct sampling rates in code when sending.  
If you use the clips I have provided and run the loop a few times with respective sampling rates, you will see the issue.

---

<div class="post-metadata">

**Author:** ![pankn](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/pankn/32/49230_2.png) [@pankn](https://devforum.zoom.us/u/pankn)\
**Post date:** [September 3, 2024, 1:08am UTC](https://devforum.zoom.us/t/meeting-sdk-sending-raw-audio-data-impacted-by-sampling-rates-and-duration/116705/5 "2024-09-03T01:08:33Z")

</div>

Hi @chunsiong.zoom, did you get a chance to look at this, were you able to see the same problem as me ?

---

<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:** [September 17, 2024, 1:19am UTC](https://devforum.zoom.us/t/meeting-sdk-sending-raw-audio-data-impacted-by-sampling-rates-and-duration/116705/6 "2024-09-17T01:19:27Z")

</div>

@pankn ,

It might be caused by `std::this_thread::sleep_for(std::chrono::milliseconds(10000)); // 10 second delay, this is a 10 second long wave file`

this might not be the best implementation, another way of sleeping might be slightly better to prevent the speeding up
