Skip to content

Instantly share code, notes, and snippets.

@potetisensei
Last active January 1, 2016 04:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save potetisensei/8094370 to your computer and use it in GitHub Desktop.
Save potetisensei/8094370 to your computer and use it in GitHub Desktop.
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