This is my code to change the frequency:
soundEvent.setTimelinePosition(timelinePosition % (int)GetEventLength(soundEvent, true));
while (!IsEventState(soundEvent, PLAYBACK_STATE.PLAYING) && !IsEventState(soundEvent, PLAYBACK_STATE.STOPPED));
soundEvent.getChannelGroup(out ChannelGroup channelGroup);
channelGroup.getGroup(0, out ChannelGroup auxGroup);
auxGroup.getChannel(0, out Channel channel);
If I don’t call flushcommands after starting the event, it doesn’t detect that event is started. Is this true?
I need to take the channel to set the frequency, but I need to wait to the event to be playing to take the channel.
I don’t know if this is the correct way to change the frequency of a sound.
Also, I want to change the frequency on update time, to play the same sound at different velocities. This includes to call flushcommands on every frame then, and my engine collapses because it takes a lot of time to perform the action. How can I solve that?
Thanks again, can anyone help with that?