SOLVED: Using Oboe produces undesired sound

Hi there,

I tried to use Oboe on Android for a pitchtracker I want to write and on my phone (Samsung Galaxy S7, Android 8.0.0, API 26), a bad 200Hz square-wave sound is produced out of nowhere. I have lent most of my code from the Spectrum Analyser Tutorial, so I did use:

setAudioChannels (2, 0);

This sound problem doesn’t happen on my emulator (9.0.0, API 28) though.

FYI I also uploaded the debug log of my app startup (Got “assertion failure” and “AAudioLoader could not find …”)

debuglog.txt (10.7 KB)

Hope someone can help me or point me towards the right direction!


Update: I could solve this by clearing the buffer before writing to it:

for (auto channel = 0; channel < maxOutputChannels; ++channel)
   bufferToFill.buffer->clear (channel, bufferToFill.startSample, bufferToFill.numSamples);

Weirdly this problem only appears when using Oboe. Can someone explain what’s happening there?