我正在尝试播放 midi 但它不起作用,我可以播放 mp3 但是当我将代码更改为 midi 并构建时 - 没有声音。(带有“bassmidi”插件)。
我的代码:
NSString *fileName = @"1";
NSString *fileType = @"mid"; // mid
BASS_Init(-1, 44100, 0, 0, 0); // initialize output device
NSString *respath=[[NSBundle mainBundle]pathForResource:fileName ofType:fileType]; // get path of audio file
HSTREAM stream=BASS_MIDI_StreamCreateFile(0, [respath UTF8String], 0, 0, BASS_SAMPLE_LOOP, 1);
BASS_ChannelPlay(stream, FALSE); // play the stream