Hello @Payal Tiwari,
I’m sharing this detailed answer not only to help with your case but also for the benefit of the community, in case someone else faces a similar issue when working with Azure Communication Services (ACS) on iOS.
Thank you so much for your patience and all the efforts you put into testing and sharing updates. After reviewing everything carefully, I can confirm that audio sharing along with screen sharing is possible on iOS with ACS, but with some important limitations. Using a Broadcast Upload Extension, you are able to capture screen frames and pass them back to your main app using App Groups. As you also discovered, it is possible to capture audio, but iOS itself does not allow apps to capture full system sounds (like music from another app or device sounds) unless private APIs are used. This is part of Apple’s security design and is explained in their ReplayKit documentation.
On the Azure side, ACS supports working with custom audio and video streams through raw media access, as explained in the Azure Communication Services Raw Media Access Overview. You were able to fix the original error by adjusting the audio format to match what ACS expects — PCM 16-bit, mono or stereo, with a sample rate of either 16kHz or 48kHz — and after that, the audio started sending successfully.
Regarding the audio glitches you noticed on the receiver side, this is something that can happen when sending raw audio over the network. To improve it, you can add a buffer to smooth out the audio and handle small network issues like jitter or packet loss. Microsoft’s iOS Raw Media Quickstart can help you set up raw media handling properly on the receiving side.
About AVAudioEngine, while it is a good tool for resampling audio if needed, your current method capturing audio in the Broadcast Extension and sending it to the app is completely fine. Since you got it working without needing AVAudioEngine, there is no need to change unless you face resampling issues later.
Hope it helps!
Please do not forget to click "Accept the answer” and yes
wherever the information provided helps you, this can be beneficial to other community members.