setPosition problem?


I have been using FMODEX for some time now and have just come across an issue with Channel::setPosition().

The issue occurs when I have a wav file larger than 2GB (I know wav files have either a 2GB or 4GB limit depending on who you talk to). I load the file as a stream and this succeeds and the current info is available via fmod about the file (num channels, length, freq, etc.). It will also play fine.

However, if I try to setPosition(pos, FMOD_TIMEUNIT_MS) when pos puts the playhead beyond the 2GB file point the call fails with the error FMOD_ERR_FILE_BAD. If I setPosition() to locations < 2GB limit it is fine. It will also play past the 2GB point fine.

I would really like this to work for me (up to the 4GB limit of the file type) since I have 16 channels of audio at 16bit PCM and I need files to be > 30mins in length.

Any thoughts?



heh ok I knew this day would probably come when people started breaking the boundaries of signed 32bit integers :slight_smile:

I’ll look into it soon.


Thanks Brett.
Glad to have been the one that bought that day closer :wink:


Do you have any updates on it?
Tested on recent 11005 version low-level API, the problem still exists.


I’m guessing that was FMOD Ex all that time ago.

Since then we switched the OS level seek to win32 setFilePointer which inherently doesn’t do >2gb seeks properly unless you specify the high part of a 64bit number as well.

I’ve updated this and it should work from now on. I’ve patched it for the next point release of 1.9 and 1.10