在OALSimpleAudio接口中,没有委托机制和通知机制告诉你什么时候预加载完成.也不需要这样的机制.
如下代码:
//Listing 11-1. Preloading a background track and playing it at //a later time
OALSimpleAudio* audio = [OALSimpleAudio sharedInstance];
[audio preloadBg:@"Audio/menu-music.m4a" seekTime:0.0];
//later you can play back the most recently preloaded track:
[audio playBgWithLoop:YES];
预加载不是多线程的,在上面这个例子里,playBgWithLoop将不会执行,除非preloadBG方法完成—–意味着已经预加载了音频文件.