ChannelGroup getNumChannels get 0

(richard) #1

i create a EventInstance,then in EVENT_CALLBACK ,
i use
FMOD.ChannelGroup group;
FMOD.RESULT r = eventInstance.getChannelGroup(out group);
if (FMOD.RESULT.OK == eventInstance.getChannelGroup(out group))

get ChannelGroup success , then, i want to get channel,

  int num = 0;
  if (FMOD.RESULT.OK == group.getNumChannels(out num))

the num is always 0, i don’t know why.

i want to get channel, is want to setPosition,
i want to play sound from statPosition where i set, like

      FMOD.Channel channel;
      if (FMOD.RESULT.OK == group.getChannel(i, out channel))
        channel.setPosition(startMs, FMOD.TIMEUNIT.MS);

is there anyone can help me to get the channel or get method to set the starPosition

(richard) #2

At last I use a tick to self tick my playing sound, not use Fmod callback!
in tick

  data.Instance.getPlaybackState(out state);

when PLAYBACK_STATE.STARTING I mark the time and setVolume(0)
in PLAYBACK_STATE.PLAYING i Judgment time interval
if time is over I set the StarMs, then setVolume(1.0f)…

(Cameron Baron) #3

The EventInstance has a function available, SetTimelinePosition. This will allow you to do the same thing from the EventInstance level instead of digging into the channel.

(Matias Lizana) #4

Hi, I want to know if you have solved the problem about the 0 number of channels on getNumChannels() function, and how to get the channel.