NSScreencast Episode #114 Playing Sounds with Sprite Kit
Playing Sounds with Sprite Kit - NSScreencast
音声を再生する
- audio files
- wav to convert smaller
- × mp3
- iphone cannot decode simultaneously
- ima4
afconvert -f caff -d ima4 in.wav -o out.caf
- hardware accelerated
- × mp3
- create group and actual folder
- Resources
- /Music
- /Sound Effects
- Resources
- GTViewController
- @import AVFoundation;
- @property (nonatomic, strong) AVAudioPlayer *audioPlayer;
- viewDidLoad
- startBackgroundMusic
- startBackgroundMusic
- GTMyScene
- initWithSize
- [self preloadSounds];
- preloadSounds
- self.giggleSounds = @[
- [SKAction playSoundFileNamed:@"laugh1.caf" waitForCompletion:YES],
- initWithSize
- pod 'SAMRateLimit'
- __block SKAction *playSound = [[SKAction alloc] init];
- [SAMRateLimit executeBlock:^{
- playSound = self.giggleSounds[arc4random_uniform((uint32_t)self.giggleSounds.count)];
- hide status bar
- × [application statusBarHidden:TRUE]
- (BOOL)prefersStatusBarHidden { return YES;
- every single view controller