I’m using FMOD 2.01.05 and currently making rhythm game using external files.
(meaning reading files outside FMOD Studio event, Unity asset path or streaming assets folder)
Here’s code I wrote for managing FMOD and sound play, using as singleton
Problem occurs when I play game in play scene.
When I push a button, it plays key sound correctly. But I also want to play clap sound to support players. but when i try to play clap sound along key sound, unity crashes with no error log.
Here’s code for that.
if (!btnPushSound[line])
{
SoundControllerFMOD.Instance.PlayKeySound(cnote.Wav, bms, cnote.Line, Const.VolumeKeySound);
SoundControllerFMOD.Instance.PlayHitSound(); // → this line makes crash
btnPushSound[line] = true;
}
Please refer to GitHub Gist link for PlayKeySound() and PlayHitSound() method.
How can I resolve this problem?
p.s. I tried to move to 2.02.11, but it does not load key sound files when loading games with my existing logic…
(you can find it with Gist link, preload~ named methods)
that’s why i’m staying with 2.01.05