0
0

Hello all,

I am working with some code which uses FMOD_System_CreateSound
to load a named sound sequence in from a file, and then uses
FMOD_Channel_GetIndex to check if it is playing. I cannot find any
documentation on the latter function in the fmodex.chm help file, the
closest by name is FMOD_CHANNELINDEX, which has a completely
different function.

The code claims that GetIndex returns either 99 or 0, depending
on whether the sound is either playing or not. The fmod library used
was originally 0.4.6.3, compiled/linked under vc++ (and it seems to do
just that in the resulting exe- return 99 or 0); currently I am debugging
a test executable using the Gnu g++/ld with fmod 0.4.22.7. In the test
exe, GetIndex returns other values as well– it seems to prefer ’90’
or 0 when the sound is not playing but occasionally returns other values
as well. (It also will occasionally behave differently on subsequent runs
of the same compiled executable, as is some state information is being
saved somewhere– the registry?)

Can anyone point me towards some documentation on this function? Has
the g++ compiler toolchain uncovered a bug in the code, or does
GetIndex actually return other values beyond 99 & 0 (what do those
mean)? Are there other, better (more consistent) ways to check if the
sound is playing?

Thanks for any help you can provide,
w1

  • You must to post comments
0
0

Try to use Channel::isPlaying() (you get the channel pointer in System::playSound()).

  • You must to post comments
0
0

> Try to use Channel::isPlaying() (you get the channel pointer in
> System::playSound()).

Hi, thank you for the advice– I tested this & it works consistently
in the code so I’m abandoning the original GetIndex call.

Thanks again!
w1

  • You must to post comments
0
0

It’s important to check the FMOD_RESULT return from isPlaying. Sometimes the channel will be stolen before you check isPlaying and it will return FMOD_ERR_INVALID_HANDLE. This error mean that’s the channel is not playing as well.

-Pete

  • You must to post comments
0
0

Hi Peter,

Thanks for the advice!

–w1

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.