# add DSP Plugin Well, but failed to play

**URL:** https://qa.fmod.com/t/add-dsp-plugin-well-but-failed-to-play/14021
**Category:** FMOD Engine
**Created:** [July 27, 2018, 6:39am UTC](https://qa.fmod.com/t/add-dsp-plugin-well-but-failed-to-play/14021 "2018-07-27T06:39:04Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![muyuenhao](https://avatars.discourse-cdn.com/v4/letter/m/ba9def/32.png) [@muyuenhao](https://qa.fmod.com/u/muyuenhao)
#### Post date: [July 27, 2018, 6:39am UTC](https://qa.fmod.com/t/add-dsp-plugin-well-but-failed-to-play/14021/1 "2018-07-27T06:39:04Z")

</div>

I have another question.When I Load a DSP Plugin like “fmod\_noise.dll” which given by fmod examples, play a song,but there is no voice at all.My code in below, I really do not know what’s wrong with it.

unsigned int baseHandle;  
unsigned int handle;  
system-\>loadPlugin(“fmod\_noise.dll”, &baseHandle);  
int count;  
system-\>getNumNestedPlugins(baseHandle, &count);  
for (int index = 0; index getNestedPlugin(baseHandle, index, &handle);  
FMOD\_PLUGINTYPE type;  
system-\>getPluginInfo(handle, &type, 0, 0, 0);  
// we have an output plugin, a dsp plugin, or a codec plugin here …  
}

result = system-\>createDSPByPlugin(handle, &mydsp);  
result = system-\>getMasterChannelGroup(&mastergroup);  
result = mastergroup-\>addDSP(0, mydsp);  
system-\>playSound(sound1, 0, false, &channel);

while (1)  
{  
system-\>update();

}

---

<div class="post-metadata">

### Author: ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)
#### Post date: [July 30, 2018, 12:07am UTC](https://qa.fmod.com/t/add-dsp-plugin-well-but-failed-to-play/14021/2 "2018-07-30T00:07:52Z")

</div>

For a generator dsp like fmod\_noise, you will want to use System::playDSP, this will add it to the tail of the channelGroup provided (masterChannel group if not specified) so you don’t want to be calling masterGroup-\>addDSP() manually.

[https://fmod.com/resources/documentation-api?page=content/generated/FMOD\_System\_PlayDSP.html#/](https://fmod.com/resources/documentation-api?page=content/generated/FMOD_System_PlayDSP.html#/)

---

<div class="post-metadata">

### Author: ![muyuenhao](https://avatars.discourse-cdn.com/v4/letter/m/ba9def/32.png) [@muyuenhao](https://qa.fmod.com/u/muyuenhao)
#### Post date: [July 30, 2018, 1:47am UTC](https://qa.fmod.com/t/add-dsp-plugin-well-but-failed-to-play/14021/3 "2018-07-30T01:47:50Z")

</div>

> [@](#):
>
> For a generator dsp like fmod\_noise, you will want to use System::playDSP, this will add it to the tail of the channelGroup provided (masterChannel group if not specified) so you don’t want to be calling masterGroup-\>addDSP() manually.
> 
> [https://fmod.com/resources/documentation-api?page=content/generated/FMOD\_System\_PlayDSP.html#/](https://fmod.com/resources/documentation-api?page=content/generated/FMOD_System_PlayDSP.html#/)

You are right, Thanks Very much.But in this method,how can I change the DSP Index?Can I Use the Channels’s method “setDSPIndex”?

---

<div class="post-metadata">

### Author: ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)
#### Post date: [August 1, 2018, 1:58am UTC](https://qa.fmod.com/t/add-dsp-plugin-well-but-failed-to-play/14021/4 "2018-08-01T01:58:53Z")

</div>

It isn’t possible to change the index of a dsp when it is used with playDSP. This is because playDSP is for playing ‘generator’ DSP’s which have no input and only output.

If you want to make your own DSP that works the same as fmod\_noise but takes in signal and mixes it with the DSP’s generated signal, you would then use it as a normal DSP and not need to use playDSP.

---

<div class="post-metadata">

### Author: ![muyuenhao](https://avatars.discourse-cdn.com/v4/letter/m/ba9def/32.png) [@muyuenhao](https://qa.fmod.com/u/muyuenhao)
#### Post date: [August 6, 2018, 7:18am UTC](https://qa.fmod.com/t/add-dsp-plugin-well-but-failed-to-play/14021/5 "2018-08-06T07:18:37Z")

</div>

As you say,that’s a complete contradiction.If I use it as a normal DSP, and call masterGroup-\>addDSP(),it plays no sound.But if I use playDSP,I cna’t chnage tje index.Am I right?

---

<div class="post-metadata">

### Author: ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)
#### Post date: [August 6, 2018, 11:06pm UTC](https://qa.fmod.com/t/add-dsp-plugin-well-but-failed-to-play/14021/6 "2018-08-06T23:06:29Z")

</div>

The reason you cannot use it as a normal DSP is because it does not use an input signal, it is used to generate signal. DSP’s used for generating signal require the use of playDSP, and no you cannot change the index when using playDSP.
