Is it possible to have a sound play before/during the splash screen?
Posted
by Jeff
on Stack Overflow
See other posts from Stack Overflow
or by Jeff
Published on 2009-09-25T15:42:02Z
Indexed on
2010/04/25
14:23 UTC
Read the original article
Hit count: 274
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!
© Stack Overflow or respective owner