# readData reading garbage the first few thousand bytes

**URL:** <https://qa.fmod.com/t/readdata-reading-garbage-the-first-few-thousand-bytes/13477>\
**Category:** FMOD Studio\
**Created:** [October 1, 2017, 12:33pm UTC](https://qa.fmod.com/t/readdata-reading-garbage-the-first-few-thousand-bytes/13477 "2017-10-01T12:33:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![grixm](https://avatars.discourse-cdn.com/v4/letter/g/c89c15/32.png) [@grixm](https://qa.fmod.com/u/grixm)\
**Post date:** [October 1, 2017, 12:33pm UTC](https://qa.fmod.com/t/readdata-reading-garbage-the-first-few-thousand-bytes/13477/1 "2017-10-01T12:33:43Z")

</div>

Hi, I’m using readData to decode files for offline analysis of FFT etc. But I have a problem with this function. I tried decoding a small chunk, about 2000 samples, but I only read what seemed like garbage, either random numbers or 0 etc. I struggled with this for a while until I tried a larger chunk, and then I saw that after about 4000 samples or so, the actual valid PCM data seem to start.

Is there a way to avoid this header or whatever it is of non-sample data at the beginning of a sound when using readData? So that when I use seekData to set the position to 0, then the first thing readData decodes are actual PCM samples at position 0.

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [October 4, 2017, 5:44am UTC](https://qa.fmod.com/t/readdata-reading-garbage-the-first-few-thousand-bytes/13477/2 "2017-10-04T05:44:43Z")

</div>

It sounds like you are using FMOD\_OPENRAW to open the file, this will load the headers as the first part of the data.  
FMOD\_OPENONLY is what you will want to use to avoid this.
