我試圖播放聲音的按鈕點擊我使用:聲音不玩xcode?
-(IBAction)sound {
NSString *path = [[NSBundle mainBundle] pathForResource:@"Beat" ofType:@"wav"];
AVAudioPlayer* theAudio=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
theAudio.delegate = self;
[theAudio play];
}
;及
#import <AVFoundation/AVAudioPlayer.h>
.h file;
- (IBAction) sound;
做我忘帶了什麼東西?
感謝的人導入音頻工具箱,你幫了我:) – 2015-05-14 21:16:29