# Custom Plug-in instrument with audiofile loading

**URL:** <https://qa.fmod.com/t/custom-plug-in-instrument-with-audiofile-loading/22353>\
**Category:** FMOD Studio\
**Created:** [November 28, 2024, 12:51pm UTC](https://qa.fmod.com/t/custom-plug-in-instrument-with-audiofile-loading/22353 "2024-11-28T12:51:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkoepke](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@mkoepke](https://qa.fmod.com/u/mkoepke)\
**Post date:** [November 28, 2024, 12:51pm UTC](https://qa.fmod.com/t/custom-plug-in-instrument-with-audiofile-loading/22353/1 "2024-11-28T12:51:17Z")

</div>

I’m working on a custom plug-in instrument that allows to load an audiofile and then process that audio.

I think I have the basic idea down; I’ve created a plugin with 0 input buffers and a data parameter, that allows to drag & drop the audio file onto the plugin. But I don’t quite understand the next steps regarding the actual use of the audio; do I need to create a sound object? If so, how do I create an instance of System within a plugin? I’m having trouble putting the stuff from the docs and API reference together on this.

Some guidance would be much appreciated.

Thank you!

Edit:  
Managed to get it working by writing the audio file to a buffer instead of using a sound object.

---

<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:** [December 4, 2024, 2:34am UTC](https://qa.fmod.com/t/custom-plug-in-instrument-with-audiofile-loading/22353/2 "2024-12-04T02:34:04Z")

</div>

> [@mkoepke](#):
>
> Managed to get it working by writing the audio file to a buffer instead of using a sound object.

This is the correct way to go about it. Since the FMOD system and API isn’t actually exposed to DSP plugins, it’s not possible to create Sound objects with them - you need to store the loaded audio data in a buffer, and provide the audio data to the output buffer in the relevant DSP callbacks (i.e. [FMOD\_DSP\_READ\_CALLBACK](https://www.fmod.com/docs/2.02/api/plugin-api-dsp.html#fmod_dsp_read_callback) or [FMOD\_DSP\_PROCESS\_CALLBACK](https://www.fmod.com/docs/2.02/api/plugin-api-dsp.html#fmod_dsp_process_callback)).
