PLAYBACK_STATE always reports back as PLAYBACK_STATE.STOPPED

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 have to call getPlaybackState a second time to get updated state.

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

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