Teams live audio interaction

Eedula, Pavan Kalyan Reddy 20 Reputation points
2025-08-16T21:23:23.85+00:00

Hi, I’ve been working on building a calling bot/agent that can actively join Microsoft Teams calls and interact with participants by capturing and processing their spoken audio. I tried using the Microsoft Graph API for live audio streaming, but I wasn’t able to receive the audio. Even the official Microsoft sample code didn’t work for me: Microsoft Graph Comms Samples.

Can anyone explain how to achieve this with Azure Communication Services (ACS) without requiring a phone number from ACS? Also, if anyone has successfully managed to capture the audio stream, could you share which sample you used?

or If anyone has successfully implemented this with Graph API or ACS, could you point me to the exact sample/project you used for audio streaming?

Microsoft Teams | Microsoft Teams for business | Meetings and calls | Audio and video
0 comments No comments
{count} votes

Accepted answer
  1. Kai-L 2,345 Reputation points Microsoft External Staff Moderator
    2025-08-16T22:17:10.16+00:00

    Dear @Eedula, Pavan Kalyan Reddy,

    Thank you for reaching out to the Microsoft Q&A Community.

    I can tell from your question that you are working on a very advanced and challenging project. Your experience with the Microsoft Graph API is a well-documented challenge, as getting direct access to raw audio streams requires a very specific setup, and I am so sorry that you've hit a roadblock with the official sample code. What you're attempting to build is a real-time media bot, and it's completely understandable that this is proving to be a complex task.

    From my research, there are two main approaches to this:

     

    1.Using Microsoft Graph API

    For real-time audio interaction, you can't use a standard bot. You must build an application-hosted media bot with the Microsoft.Graph.Communications.Calls.Media .NET library. This type of bot receives a live stream of audio (and video) frames, allowing you to perform real-time processing, like transcription or natural language processing, as it happens.

    The key requirements for this approach are very specific and are often the reason why samples fail:

    • The bot must be deployed on a Windows Server operating system, either on-premises or in Azure.
    • It requires specific port ranges to be opened for media traffic.
    • It must use the Microsoft.Graph.Communications.Calls.Media SDK, which provides a "socket-like" API for accessing the raw media streams.

    For references: 

    Real-time Media Call & Meeting for Bots - Teams | Microsoft Learn

    Build Application-hosted Media Bots - Teams | Microsoft Learn

    Choose a media hosting option by using the cloud communications API - Microsoft Graph | Microsoft Learn

    Bots for Teams Calls and Online Meeting - Teams | Microsoft Learn

     

    2.Using Azure Communication Services (ACS)

    You can build a bot that joins a Teams meeting using the ACS Call Automation SDK, which is specifically designed for server-based intelligent calling workflows.

    Instead of a phone number, your bot would join the Teams meeting using a Teams user's ID or an ACS identity. From there, you can use the SDK to access and stream the audio to a server (often via a WebSocket), which then performs the processing. This approach is powerful because it allows for full interoperability with Teams meetings and can be integrated with various AI services.

    Microsoft's documentation provides a quickstart guide for setting up this kind of real-time audio streaming. It demonstrates how to use the SDKs to receive and process the audio stream from a call.

    For reference: Call Automation Teams Interop overview - An Azure Communication Services concept document | Microsoft Learn

     

    Given the complexity you're experiencing with this issue, it's a matter that is beyond what we can provide here in the forum. For issues like this, I strongly recommend raising a support ticket with the Microsoft Support team. They have the necessary tools and permissions and can offer targeted solutions that go beyond what we can provide here in the forum. Therefore, I strongly recommend raising a support ticket with the Microsoft Support team. They can initiate a live troubleshooting session and, if necessary, escalate your case to a specialized team equipped to handle such issues.   

    As an admin in your organization, to create a Support ticket, you can go to Microsoft 365 admin center 

    User's image

    • After that choose the "Contact support"
       

    User's image

    • Fill out the required information in the form, including a description of the issue you are experiencing. 
    • Click on the "Create" button to submit your request. Which will give you a ticket number. 
    • Once your request is submitted, a support engineer will be assigned to your case and will contact you to provide assistance.    

    I'm sincerely sorry that I can't assist you further at this stage, but this matter may be beyond our current capacity. Once you have a Support Ticket ID, you can share it with me here in the Microsoft Community via a private message. This will allow me to track the progress and ensure your case receives the necessary attention.

    I will keep this post open to see if other professionals in the community have a different solution.

    Thank you for your patience and understanding. Have a wonderful weekend!


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1 additional answer

Sort by: Most helpful
  1. Eedula, Pavan Kalyan Reddy 20 Reputation points
    2025-08-20T06:59:48.87+00:00

    Dear @Kai-L

    Thank you for your understanding and for the detailed response. After following up for two months with Microsoft, my ticket was considered for an advisory call. During that call, they mentioned that the example from the comms sample PolicyRecordingBot is outdated and may eventually be deprecated. Instead, they suggested I use the IncidentBot.

    However, that sample is not really designed for the application-hosted configuration I’m working with. As I mentioned earlier, I created a bot that joins the call and speaks to participants, but I was unable to capture the audio reliably—I only got a few minutes of recording as output, which seems to be a limitation of the service-hosted configuration since it wasn’t intended to be used that way.

    Now, I’m trying to approach this the way you’ve explained. Would you be able to give me some time to work on this? If I encounter blockers that require review, I’ll raise a case and share it with you, as you had advised earlier. I’ll explore both options—the ACS and the bot—but I believe my goal is more closely aligned with the bot itself, specifically the Microsoft.Graph.Communications.Calls.Media .NET library, since it wouldn’t require approval to join meetings. At the same time, I’ll also look into ACS. I plan to prepare code samples with debugging so that someone can clearly see what happened with the code.

    Thanks again for your continued support.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.