My app takes a few seconds to load and I have a splash screen. Once “viewDidLoad” I have a little sound play. I feel that the sound would be in better use if it started playing when the splash screen popped up. Is it possible to have a sound start before/during the splash screen?
Here is my code: (under viewDidLoad)
NSString *soundFilePath = [[NSBundle mainBundle] pathForResource: @"intorSound" ofType: @"aif"];
NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: soundFilePath];
player = [[AVAudioPlayer alloc] initWithContentsOfURL: fileURL error: nil];
[player setVolume: soundVolumeValue]; // available range is 0.0 through 1.0
[player play];
[fileURL release];
Thank you for your time!
A little trick is to use the same splash screen as your Default.png, making a seamless transition into code you control. When applicationDidLaunch gets called, start your sound playback, and display the splash screen. If you want, you can put a little progress indicator up onto the splash screen as well. In viewDidLoad, when you are done with all initialization, do a 2-5 second or so fade of the splashscreen. You can throw in code to dismiss the splash screen with a tap, thus giving people some time to read the splash screen or tap it to dismiss it. This all makes the amount of time that the Default.png is displayed with no sound seem insignificant.