How to stream audio, video and screen share to backend over WebSocket in C# Teams bot and play audio response back into call

SHUBHAM TRIPATHI 20 Reputation points
2025-05-06T09:24:57.2633333+00:00

Looking for help with a Microsoft Teams bot built in C#. The bot needs to stream audio, video, and screen sharing from a Teams call to a backend server using WebSocket. It should also get an audio response from the backend and play it back into the call. Please share any sample GitHub repo or code example that shows how to do this. Any guidance would be really helpful.

Microsoft Teams | Development
{count} votes

2 answers

Sort by: Most helpful
  1. Ayush Giri 245 Reputation points Microsoft External Staff
    2025-05-07T05:27:05.37+00:00

    Hello Shubham,
    To build a Microsoft Teams bot in C# that streams audio, video, and screen sharing to a backend server over WebSocket—and plays audio responses back into the call—you'll need to leverage the Microsoft Graph Communications SDK and set up a WebSocket server for media streaming.

    This is a Microsoft Teams Samples Repository which demonstrates how to build a Microsoft Teams bot in C# that streams audio, video, and screen sharing to a backend server over WebSocket, and plays audio responses back into the call.
    https://github.com/OfficeDev/Microsoft-Teams-Samples/pull/1452

    Please go through this and tell what challenges you are facing or any other questions you have, so that I can help.

    If the response is helpful, please click "upvote" and upvote it. You can share your feedback via https://aka.ms/DevSupportFeedback)) link. Click here to escalate.

    0 comments No comments

  2. Ayush Giri 245 Reputation points Microsoft External Staff
    2025-05-09T06:18:47.5033333+00:00

    Hello Shubham,
    Can you please provide your feedback whether this is working for you or not.


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.