0
0

Hi, I have a problem with Channel::getPosition().

Channel->getPosition(&nCurrMS, FMOD_TIMEUNIT_MS); // —A
Channel->getPosition(&nCurrByte, FMOD_TIMEUNIT_RAWBYTES); /—B
nCurrMS = max(1, nCurrMS); //prevent being divided by 0
nKBPS = (int)((float)nCurrByte /(float)nCurrMS * 2*4);

I counted raw bytes, and elapsed time in second of a network stream like this.

When I stoped the allocated channel and assgned NULL, and then restarted the network stream. a big problem took place.

Statement A counted milliseconds from 0, but statement B counted raw bytes from the previous position. As a result nKBPS was too big.

How can I fix this promblem? Help me!

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.