Floating point exception when using WASAPI AudioDevice


When I unmask floating point exceptions in my application, and switch from DirectSound to the Windows Audio AudioDevice, I get a divide by zero:

oid AudioDeviceManager::audioDeviceIOCallbackInt (const float** inputChannelData,
                                                   int numInputChannels,
                                                   float** outputChannelData,
                                                   int numOutputChannels,
                                                   int numSamples)
    const ScopedLock sl (audioCallbackLock);

    if (inputLevelMeasurementEnabledCount > 0)
        for (int j = 0; j < numSamples; ++j)
            float s = 0;

            for (int i = 0; i < numInputChannels; ++i)
                s += std::abs (inputChannelData[i][j]);

            s /= numInputChannels; // DIVIDE BY ZERO

numInputChannels is zero, since I have no input devices.


Ok, thanks for the heads-up!