iPhone 播放 midi 文件的方法
2010-08-29 01:41:00 来源:WEB开发网[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)viewDidUnload {
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (void)dealloc {
[status release], status = nil;
[time release], time = nil;
[super dealloc];
}
- (void)viewWillAppear:(BOOL)animated
{
FMOD_RESULT result = FMOD_OK;
char buffer[200] = {0};
unsigned int version = 0;
/*
Create a System object and initialize
*/
result = FMOD::System_Create(&system);
ERRCHECK(result);
result = system->getVersion(&version);
ERRCHECK(result);
if (version < FMOD_VERSION)
{
fprintf(stderr, "You are using an old version of FMOD %08x. This program requires %08x ", version, FMOD_VERSION);
exit(-1);
}
result = system->init(32, FMOD_INIT_NORMAL | FMOD_INIT_ENABLE_PROFILE, NULL);
ERRCHECK(result);
// set up DLS file
FMOD_CREATESOUNDEXINFO soundExInfo;
memset(&soundExInfo, 0, sizeof(FMOD_CREATESOUNDEXINFO));
soundExInfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO);
char dlsName[200] = {0};
[[NSString stringWithFormat:@"%@/gm.dls", [[NSBundle mainBundle] resourcePath]] getCString:dlsName maxLength:200 encoding:NSASCIIStringEncoding];
soundExInfo.dlsname = dlsName;
// midi one
[[NSString stringWithFormat:@"%@/Bass_sample.mid", [[NSBundle mainBundle] resourcePath]] getCString:buffer maxLength:200 encoding:NSASCIIStringEncoding];
result = system->createSound(buffer, FMOD_SOFTWARE | FMOD_CREATESTREAM, &soundExInfo, &sound1);
// ERRCHECK(result);
- ››iphone图片拉伸的几种方法
- ››iphone正则表达式的简单使用
- ››iPhone开发Unresolved Symbols CAKeyframeAnimati...
- ››IPhone开发-“此证书是由未知颁发机构签名”解决方...
- ››IPhone开发-整合私钥和证书,生成.p12文件
- ››iPhone应用开发-UIPickerView选取器详解
- ››iphone 获取屏幕的宽度和高度
- ››iPhone读取工程包中的二进制文件
- ››iPhone新手机 不挂YouTube APP
- ››iPhone 获取指定格式的时间和日期
- ››iPhone版PPS走进生活 观赏体验媲美PC版
- ››播放器中常用:右键菜单全屏与退出全屏的切换[AS3...
更多精彩
赞助商链接