# Record example meaningless variable

**URL:** <https://qa.fmod.com/t/record-example-meaningless-variable/22871>\
**Category:** Unity\
**Tags:** unity, csharp\
**Created:** [May 3, 2025, 2:20am UTC](https://qa.fmod.com/t/record-example-meaningless-variable/22871 "2025-05-03T02:20:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hardsmoke](https://avatars.discourse-cdn.com/v4/letter/h/e9a140/32.png) [@hardsmoke](https://qa.fmod.com/u/hardsmoke)\
**Post date:** [May 3, 2025, 2:20am UTC](https://qa.fmod.com/t/record-example-meaningless-variable/22871/1 "2025-05-03T02:20:41Z")

</div>

Hello.  
I’m trying to figure out the code with the microphone [recording example](https://www.fmod.com/docs/2.03/unity/examples-record.html).  
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.

```auto
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.

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [May 5, 2025, 7:04am UTC](https://qa.fmod.com/t/record-example-meaningless-variable/22871/2 "2025-05-05T07:04:13Z")

</div>

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.
