0
0

Every time it executes the line before I return returnV pointer, returnV keeps resting back too 0, can someone help?

[code:flbp0wm4]int Audio::GetMusicSecond(){
channel->getCurrentSound(&sound);
unsigned int pos = 0;
result = channel->getPosition(&pos,FMOD_TIMEUNIT_MS);
int returnV = (int)pos / 1000 % 60;

    return returnV;

}[/code:flbp0wm4]

I think this is more of a C++ problem, but im not sure.

  • You must to post comments
0
0

The only things I can see that would cause returnV to be 0 are pos being less than 1000 (due to integer division by 1000), or pos being a multiple of 60000 (due to the "% 60" operation).

Are either of these things true? What is the value of pos after the call to channel->getPosition? What result does channel->getPosition return?

  • You must to post comments
0
0

Forgot about this thread, sorry. Yeah I got it working, never mind.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.