# Programmer sound with FMOD\_CREATESTREAM flag ends too early

**URL:** <https://qa.fmod.com/t/programmer-sound-with-fmod-createstream-flag-ends-too-early/19527>\
**Category:** FMOD Engine\
**Created:** [November 15, 2022, 3:34pm UTC](https://qa.fmod.com/t/programmer-sound-with-fmod-createstream-flag-ends-too-early/19527 "2022-11-15T15:34:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlfredSaber](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@AlfredSaber](https://qa.fmod.com/u/AlfredSaber)\
**Post date:** [November 15, 2022, 3:34pm UTC](https://qa.fmod.com/t/programmer-sound-with-fmod-createstream-flag-ends-too-early/19527/1 "2022-11-15T15:34:34Z")

</div>

Hello! I have an issue where a specific event ends too early. I’m creating the sounds with FMOD\_CREATESTREAM and a pcmreadcallback. The decoding of the sounds is running on a separate thread.

For the most part this is working like I expect it too, but there is one place where a dialog cuts out about halfway through (never in the exact same place). If I don’t use the stream-flag and provie the whole decoded file at once it doesn’t break. The provided length when the sound is created is correct.

I haven’t caught it in any of the Stop-functions in code before it gets to the destroy programmer sound callback. All the data is already decoded and ready to be used at this point as well. I seem to be getting no relevant logs from FMOD either. Could it be something happening internally in FMOD?

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [November 20, 2022, 10:39pm UTC](https://qa.fmod.com/t/programmer-sound-with-fmod-createstream-flag-ends-too-early/19527/2 "2022-11-20T22:39:27Z")

</div>

Unfortunately I haven’t been able to reproduce your issue - since you’re referring to a specific event, could you provide more info on it, as well as a your `pcmreadcallback` code?
