Record example meaningless variable

Hello.
I’m trying to figure out the code with the microphone recording example.
I can’t figure out what the minRecordDelta variable is for if it’s always 0 and recordData will never be less than 0, so the code snippet will never execute.

uint minRecordDelta = 0;
if (recordDelta != 0 && (recordDelta < minRecordDelta))
{
      minRecordDelta = recordDelta; // Smallest driver granularity seen so far
      adjustLatency = (recordDelta <= desiredLatency) ? desiredLatency : recordDelta; // Adjust our latency if driver granularity is high
}

Thanks.

1 Like

Hi,

Thank you for bringing this to our attention. You are correct, that is an error. The minRecordDelta should be a member variable and shouldn’t be reset every update. To fix the error please remove that line and replace it with private uint minRecordDelta = 0xFFFFFFFF; under line 19.

I have made a task to fix this.

Thank you again.