# Record fmod in an video

**URL:** https://qa.fmod.com/t/record-fmod-in-an-video/20497
**Category:** Unity
**Created:** [August 3, 2023, 11:03am UTC](https://qa.fmod.com/t/record-fmod-in-an-video/20497 "2023-08-03T11:03:48Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)
#### Post date: [August 7, 2023, 2:30am UTC](https://qa.fmod.com/t/record-fmod-in-an-video/20497/5 "2023-08-07T02:30:59Z")

</div>

> [@willim](#):
>
> Looking at another example of ScriptUsageDspCapture you mentioned, how does CaptureDSPReadCallback get all of fmod’s output? Can you show the code? Thanks a million!!

`ScriptUsageDspCapture` creates a custom DSP which is placed on the FMOD System’s Master Channel Group, with a custom static read callback `CaptureDSPReadCallback()`. The read callback is called by the FMOD System with every mixer update and receives the audio signal that flows into the DSP, allowing you to directly access and/or modify the signal.

Additionally, you also pass the entire instance of the class `ScriptUsageDspCapture` to the DSP as user data. The class instance is then accessed from the user data within the callback, and the incoming audio signal is copied to the class member `mDataBuffer`. The data copied to `mDataBuffer` within the callback is then processed in `ScriptUsageDspCapture.Update()`.

In the case of the scripting example, the data is used in `Update()` to draw the signal’s waveform, but for your purposes you’d instead want to accumulate all of the audio data and then presumably save it to file - that’s where the response linked in the other thread regarding writing to .wav comes in: [record and output to .wav file - #2 by mathew](https://qa.fmod.com/t/record-and-output-to-wav-file/12151/2)

---

_[View the full topic](https://qa.fmod.com/t/record-fmod-in-an-video/20497)._
