Created
July 19, 2019 01:31
-
-
Save SunXiaoShan/60b28c9960662a60a5c3a9132d18c1cb 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
- (AudioFileID)loadAudioFile:(NSString *)audioPath { | |
AudioFileID audioFile; | |
OSStatus status = AudioFileOpenURL( | |
(__bridge CFURLRef _Nonnull)([NSURL fileURLWithPath:audioPath]), | |
kAudioFileReadPermission, | |
0, | |
&audioFile); | |
if (status != noErr) { | |
NSLog(@"Load file failed %d", status); | |
return nil; | |
} | |
return audioFile; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment