WEB开发网
开发学院手机开发iPhone 开发 iPhone 播放 midi 文件的方法 阅读

iPhone 播放 midi 文件的方法

 2010-08-29 01:41:00 来源:WEB开发网   
核心提示:result = sound1->setMode(FMOD_LOOP_OFF);// ERRCHECK(result);// midi two[[NSString stringWithFormat:@"%@/Drum_sample.mid", [[NSBundle mainBundle] re

result = sound1->setMode(FMOD_LOOP_OFF);

// ERRCHECK(result);

// midi two

[[NSString stringWithFormat:@"%@/Drum_sample.mid", [[NSBundle mainBundle] resourcePath]] getCString:buffer maxLength:200 encoding:NSASCIIStringEncoding];

result = system->createSound(buffer, FMOD_SOFTWARE | FMOD_CREATESTREAM, &soundExInfo, &sound2);

result = sound2->setMode(FMOD_LOOP_OFF);

// timer = [NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(timerUpdate:) userInfo:nil repeats:YES];

}

- (IBAction)playSound1:(id)sender

{

FMOD_RESULT result = FMOD_OK;

result = system->playSound(FMOD_CHANNEL_FREE, sound1, false, &channel);

ERRCHECK(result);

}

- (IBAction)playSound2:(id)sender

{

FMOD_RESULT result = FMOD_OK;

result = system->playSound(FMOD_CHANNEL_FREE, sound2, false, &channel);

ERRCHECK(result);

}

- (void)timerUpdate:(NSTimer *)timer

{

}

@end

上一页  1 2 3 

Tags:iPhone 播放 midi

编辑录入:coldstar [复制链接] [打 印]
赞助商链接