# Record Example fails with FMOD\_ERR\_INVALID\_HANDLE

**URL:** <https://qa.fmod.com/t/record-example-fails-with-fmod-err-invalid-handle/18435>\
**Category:** FMOD Engine\
**Created:** [February 23, 2022, 9:43pm UTC](https://qa.fmod.com/t/record-example-fails-with-fmod-err-invalid-handle/18435 "2022-02-23T21:43:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iADBE](https://avatars.discourse-cdn.com/v4/letter/i/8e7dd6/32.png) [@iADBE](https://qa.fmod.com/u/iADBE)\
**Post date:** [February 23, 2022, 9:43pm UTC](https://qa.fmod.com/t/record-example-fails-with-fmod-err-invalid-handle/18435/1 "2022-02-23T21:43:35Z")

</div>

Working with the Record FMOD core api example attached with debugging. I keep running into this error on this line of code:

```
            result = channel[13]->getPosition(&playPos, FMOD_TIMEUNIT_PCM);

```

Not sure why it does this.

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [March 2, 2022, 5:54am UTC](https://qa.fmod.com/t/record-example-fails-with-fmod-err-invalid-handle/18435/2 "2022-03-02T05:54:10Z")

</div>

Is `channel[13]` non null and did it return `FMOD_OK` when you played the sound that created it?

---

<div class="post-metadata">

**Author:** ![iADBE](https://avatars.discourse-cdn.com/v4/letter/i/8e7dd6/32.png) [@iADBE](https://qa.fmod.com/u/iADBE)\
**Post date:** [March 2, 2022, 4:02pm UTC](https://qa.fmod.com/t/record-example-fails-with-fmod-err-invalid-handle/18435/3 "2022-03-02T16:02:05Z")

</div>

I recently changed my code around using the record enumeration example i was able to overcome my issue and was able to have delayed recording playback. At the time channel[13] was non null but it skipped this line of code through its first fire of execution

if (!channel && samplesRecorded \>= adjustedLatency)  
{  
result = system-\>playSound(sound, 0, false, &channel);  
ERRCHECK(result);  
}

So it never was able to play the sound.
