Hi, I’m newbie to JUCE. I’m trying to build a JUCE audio backend for unity for best latency, and I try to get all available buffer sizes and set. It work perfectly on Windows. On my Pixel4 the result is 96, 192, 384…etc(96 x n) and the default buffer size is 1920. I try to modify buffer size and test the latency, the info shows that buffer size changed but latency results gets the same 60-70ms(almost twice of Oboe tester), which is weird and seem set buffer size is not work on Oboe?
Am I miss anything?
Here is the C++ code
void NativeAudioManager::GetBufferSizes(int*& bufferSizes, int& count)
{
auto* device = audioDeviceManager->getCurrentAudioDevice();
auto availableBufferSizesArray = device->getAvailableBufferSizes();
count = availableBufferSizesArray.size();
//Reset if need
//std::vector<int> type
_bufferSizes.resize(count);
for (int i = 0; i < count; i++)
{
_bufferSizes[i] = availableBufferSizesArray[i];
}
bufferSizes = _bufferSizes.data();
}
void NativeAudioManager::SetCurrentBufferSize(int bufferSize)
{
audioDeviceManager->getAudioDeviceSetup(_setup);
_setup.bufferSize = bufferSize;
auto message = audioDeviceManager->setAudioDeviceSetup(_setup, true);
if (message.length() != 0)
{
NativeDebugger::LogError(message.toStdString());
}
}