Last active
January 1, 2016 04:49
-
-
Save potetisensei/8094370 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char [AudioManager loadBgmData:](struct AudioManager *self, SEL selector, id bgm_data) | |
{ | |
NSError *has_occured; | |
if (bgm_data == nil) return 0; | |
self._bgmPlayer = [AVAudioPlayer alloc]; | |
[self._bgmPlayer initWithData: bgm_data error: &has_occured]; | |
if (has_occured == nil) { | |
[self._bgmPlayer setDelegate:self]; | |
[self._bgmPlayer prepareToPlay]; | |
return 1; | |
} else { | |
return 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment