Disable Audio Input


I am working on a midi synthesizer. When compiling it as an AU and running it with PluginHost, the sound of my default input mic is run to the output, while there is no connection in the graph between the "Audio Input" box and my plugin box. This does not occur, though, with the VST version of the plugin.

How can I make sure that my plugin doesn't take any audio data in ?

I have tried to set the number of input channels to 0 using the setPlayConfigDetails method, both in the initalizer and in the prepareToPlay method, but it didn't work.

Any hints ?




I think you may have forgotten to clear the output audio channels of your plug-in in the processBlock method. The audioBuffer supplied to the processBlock method will have at least as many channels as the number of outputs. This means that the audioBuffer will have channels even if the AudioProcessor has no inputs. The contents of  these channels will be undefined (and may - by chance - contain the audio data of the mic) at the beginning of the processBlock method if your AudioProcessor has no inputs. This is expected behaviour. You should clear the audio buffer before rendering into them. Does this make sense? 

That is actually what I did, but I thought it was a loss of energy to have to clear a buffer instead of starting with a new empty one, or just desactivate any audio input listening.

Thanks for clearing that out.

Have a nice day,



By the way,

Any idea why this happens with Audio Units and not with VST's ?

Something has to clear that buffer. If your code didn't do it then the library or DAW or OS would have to do it. But for plugins that write non-zero data into it, then it would be inefficient if the library or DAW cleared the buffer and then the plugin immediately overwrote it with data.