Search code examples
.netnaudio

Trying to setup the buffer size using the MultiplexingWaveProvider with an ASIO Device


I have something like the following code

   _deviceOutput = new AsioOut("Driver name");
    _padFile = new WaveFileReader(padStream); //using a memory stream
    _headphoneFile = new WaveFileReader(headphoneStream); //using a memory stream
    var multiplexer = new MultiplexingWaveProvider(new IWaveProvider[] {_headphoneFile, _padFile},
                                                           _deviceOutput.DriverOutputChannelCount);
    _deviceOutput.Init(multiplexer);
    _deviceOutput.Play();

I need to increase the buffer size to reduce pops and clicks in the output audio. How can I set up the buffer size through code?


Solution

  • I'm afraid the ASIO API offers no standardized way to set the buffer size. What you are expected to do is call the API to show the control panel, which will almost always offer the user a choice of buffer sizes.