0
0

Hi all,

I am trying to create a code that plays 2 or more mp3 songs in a raw with crossfade. Below is the code that I have created until now, but it does not work. The second song does not even start!!!
Could somebody, please, provide a working code about how to play two songs with crossfading?

My Code:

ERRCHECK(system.createChannelGroup(null, ref channelGroup2));

ERRCHECK(system.createSound(@"C:\Users\Peter\Downloads\song1.mp3", FMOD.MODE.SOFTWARE, ref song1));
ERRCHECK(system.createSound(@"C:\Users\Peter\Downloads\song2.mp3", FMOD.MODE.SOFTWARE, ref song2));

system.createSoundGroup(null, ref soundGroup2);
soundGroup2.setMaxAudibleBehavior(SOUNDGROUP_BEHAVIOR.BEHAVIOR_MUTE);
soundGroup2.setMuteFadeSpeed(10);
soundGroup2.setMaxAudible(1);

song1.setSoundGroup(soundGroup2);
song2.setSoundGroup(soundGroup2);

ERRCHECK(system.playSound(FMOD.CHANNELINDEX.FREE, song1, true, ref channel2));

channel2.setPaused(false);

Thanks in advance

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.