AudioServicesPlaySystemSound를 사용하는 데 문제가 있습니다. 출력물이 스피커를 통과 할 때 큰 효과가 있습니다. 그러나 사용자가 헤드폰을 연결할 때 출력이 없습니다. 어떤 종류의 청취자를 설치하는 쉬운 방법이있어 오디오를 꽂았을 때 헤드폰을 통해 자동으로 라우트되거나 스피커를 통해 자동으로 라우트됩니다.iPhone AudioServicesPlaySystemSound : 헤드폰을 통해 경로를 지정 하시겠습니까?
나는 짧고 간단한 AIF 사운드 샘플을 재생하려면 다음과 같은 방법을 사용하고 있습니다 :
-(void)playAif:(NSString *)filename {
SystemSoundID soundID;
NSString *path = [[NSBundle mainBundle]
pathForResource:filename ofType:@"aif"];
if (path) { // test for path, to guard against crashes
AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:path],&soundID);
AudioServicesPlaySystemSound (soundID);
}
}
는 내가 모르는 뭔가가 있어야합니다 알고,이 작업을 수행 할 설정의 일부 비트. 어떤 아이디어?
AudioSessions -http : //developer.apple.com/library/ios/#documentation/Audio/Conceptual/AudioSessionProgrammingGuide/Configuration/Configuration.html#//apple_ref/doc/uid/TP40007875-CH3- SW1 – Till
물고기를 가르쳐 준 덕분에 @ 감사합니다! 이전에 문서를 확인했지만 관련 정보를 놓쳤습니다. 후손을위한 해결책으로 아래의 질문을 업데이트하십시오. 감사! –