I am getting 0 sample values in my audioDeviceIOCallbackwithContext function. I have this simple code:
for (int sampleNo = 0; sampleNo < numSamples; ++sampleNo) {
for (int channel = 0; channel < numInputChannels; ++channel) {
const float* inputData = inputChannelData[channel];
if (inputData != nullptr && inputData[sampleNo] != 0.0f) {
DBG("Input sample[" << channel << "][" << sampleNo << "]: " << inputData[sampleNo]);"
}
}
}
noCallbacks++;
DBG(noCallbacks);
which just generates incremental callback values.
I have tried it when connected to both a Presonus 64S and a MOTU 828es. I can see USB channels active when I use a mixer in a DAW.
In my MainComponent, I have:
// Initialize and configure deviceManager here if needed
error = deviceManager.initialise(8, 2, nullptr, true);
if (!error.isEmpty()) {
// Handle initialization error
DBG("AudioDeviceManager initialization failed: " + error);
}
// Set the output device to "MacBook Pro Speakers"
setup.outputDeviceName = "MacBook Pro Speakers";
setup.inputDeviceName = "Studio 828es"; // Ensure input device is also set
// Apply the new device setup
error = deviceManager.setAudioDeviceSetup(setup, true);
if (!error.isEmpty()) {
// Handle setup error
DBG("AudioDeviceSetup failed: " + error);
}
// Verify the device setup
setup = deviceManager.getAudioDeviceSetup();
DBG("Input and Output device names after applying setup: ");
// Add the audio callback
deviceManager.addAudioCallback(&AudioCallBack);
AudioCallBack.startAudioProcessing()
I get the following output from the device manager setup:
Input and Output device names after applying setup:
Studio 828es
MacBook Pro Speakers
Everything seems to work as expected except for no audio! Any guidance would be much appreciated.
