ios - mixing midi files, each with own sound font

后端 未结 3 1335
半阙折子戏
半阙折子戏 2021-01-01 05:12

I\'m looking for a way to mix 2 or more midi files, each with their own sound font files. I\'ve found the following code for one file and tried to do multiple music players

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-01 05:39

    I had exactly same issue as you. All tracks play with the first sound font instrument. I followed your solution but it not work at first. Finally, I resolve the problem. As your mentioned, the sequence of calling functions really maters. Yes, it is. Actually, the sequence calling should be like this:

    .....
    MusicSequenceSetAUGraph(s, _processingGraph);
    .......
    MusicTrackSetDestNode(track[i], samplerNodes[i]);
    ......
    [self loadFromDLSOrSoundFont];
    ......
    MusicPlayerStart(p);
    

    This works in my project.

提交回复
热议问题