Answered
0
0

Hello

I’m trying to find out the state of the music that is playing.

With the below code, it always reports back as PLAYBACK_STATE.STOPPED. I would expect the second log message to tell me it is PLAYBACK_STATE.PLAYING.

What am I doing wrong here?

private FMOD.Studio.EventInstance music;

        private FMOD.Studio.PLAYBACK_STATE  musicPlaybackState;
void Start ()
        {
                music = FMOD_StudioSystem.instance.GetEvent ("event:/Music");
                music.getPlaybackState (out musicPlaybackState);

                Debug.Log ("state: " + musicPlaybackState);
                music.start ();
                Debug.Log ("state: " + musicPlaybackState);

        }

Thanks,
Jeroen

  • You must to post comments
Best Answer
0
0

You have to call getPlaybackState a second time to get updated state.

  • You must to post comments
0
0

Thanks Nicholas. That’s seems like an awful lot of trouble just to get the playback state. :)

Is there an easier way to check if an event is playing?

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.