0
0

i create a EventInstance,then in EVENT_CALLBACK ,
where case FMOD.Studio.EVENT_CALLBACK_TYPE.CREATED:
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

  • You must to post comments
0
0

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

  PLAYBACK_STATE state;
  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)…

  • You must to post comments
0
0

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.

https://fmod.com/resources/documentation-api?page=content/generated/FMOD_Studio_EventInstance_SetTimelinePosition.html#/

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.