# Capturing raw audio data on the server side

**URL:** <https://mediasoup.discourse.group/t/capturing-raw-audio-data-on-the-server-side/6324>\
**Category:** mediasoup libraries\
**Created:** [November 5, 2024, 10:42am UTC](https://mediasoup.discourse.group/t/capturing-raw-audio-data-on-the-server-side/6324 "2024-11-05T10:42:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![FredTheNoob](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/fredthenoob/32/2717_2.png) [@FredTheNoob](https://mediasoup.discourse.group/u/FredTheNoob)\
**Post date:** [November 5, 2024, 10:42am UTC](https://mediasoup.discourse.group/t/capturing-raw-audio-data-on-the-server-side/6324/1 "2024-11-05T10:42:43Z")

</div>

I am using this github repo as a base: [GitHub - Dirvann/mediasoup-sfu-webrtc-video-rooms: A simple video conferencing example using the mediasoup sfu](https://github.com/Dirvann/mediasoup-sfu-webrtc-video-rooms)

I would like to extend it, such that I can read the raw audio data on the server side and do something with it (specifically throw it into a whisper model for transcription). I’ve tried using the consumer.on(“rtp”) event but it does not seem to be firing, I should note that I am using createWebRtcTransport and not createDirectTransport, as I was unable to get that to work.

Anyone else that has dealt with similar issues?

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [November 5, 2024, 10:48am UTC](https://mediasoup.discourse.group/t/capturing-raw-audio-data-on-the-server-side/6324/2 "2024-11-05T10:48:52Z")

</div>

If you are not using `createDirectTransport()` to get a `DirectTransport` and later create a `consumer` on it and listen for ‘rtp’ event on it, then of course it won’t work. If you have a problem doing the former, then specify the problem instead of trying things that, as per documentation, won’t work.

---

<div class="post-metadata">

**Author:** ![FredTheNoob](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/fredthenoob/32/2717_2.png) [@FredTheNoob](https://mediasoup.discourse.group/u/FredTheNoob)\
**Post date:** [November 5, 2024, 10:50am UTC](https://mediasoup.discourse.group/t/capturing-raw-audio-data-on-the-server-side/6324/3 "2024-11-05T10:50:49Z")

</div>

That makes sense. Are there any examples available on how to use direct transport? Because I am a bit confused as to what I should do. Replace WebRtcTransport with DirectTransport or keep both?

---

<div class="post-metadata">

**Author:** ![BlueMagnificent](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/bluemagnificent/32/841_2.png) [@BlueMagnificent](https://mediasoup.discourse.group/u/BlueMagnificent)\
**Post date:** [November 16, 2024, 8:22pm UTC](https://mediasoup.discourse.group/t/capturing-raw-audio-data-on-the-server-side/6324/4 "2024-11-16T20:22:05Z")

</div>

If you are after capturing the raw audio data from the server then what you need is a `PlainTransport` to stream the needed audio out of mediasoup to an external endpoint/application (ffmpeg, gstreamer) that can decode it and give you the raw audio data. [Consuming Media in an External Endpoint (RTP Out)](https://mediasoup.org/documentation/v3/communication-between-client-and-server/#consuming-media-in-an-external-endpoint)
