아주 간단한 앱을 만드는 중입니다. 2 개의 버튼은 모두 소리를냅니다. 각 클립은 1 초 동안 지속되며 "TouchUpInside"에 응답합니다. 그것들은 iTunes에서 변환 한 .caf 파일입니다. 여기 오디오가 시뮬레이터에서는 작동하지만 iPad에서는 작동하지 않는 이유는 무엇입니까?
다시 한 번,이 시뮬레이터에서 작동하지만 장치에, 내 코드입니다 :enter code here- (void)viewDidLoad {
NSLog(@"InView did load");
AudioServicesCreateSystemSoundID ((CFURLRef)[NSURL fileURLWithPath:[[NSBundle mainBundle]pathForResource:@"bigaif" ofType:@"caf"]], &systemSoundID);
AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:[[NSBundle mainBundle]
pathForResource: @"smallwav" ofType:@"wav"]],
&systemSoundIDTwo);
가}
-(IBAction) playSound:(id) sender {
AudioServicesPlaySystemSound(systemSoundID);
}
-(IBAction) playSoundTwo:(id) sender {
AudioServicesPlaySystemSound(systemSoundIDTwo);
}
파일 이름에 아무런 문제가 없습니까? 사실 맥이 캐핑핑으로 설정되었고 파일 이름에 오타가 있었기 때문에 동일한 상황이었습니다. – aknew
음, 혼자서 알아 냈습니다. 다른 사람들이이 실수를하지 않도록 솔루션을 게시하고 싶습니다. "SystemSound"를 사용하는 경우 설정에서 시스템 사운드가 나타나는지 확인하십시오. – JoshD