2012-05-24 1 views
2

누구든지 OS X에서 복사, 붙여 넣기 및 삭제 작업 (끌기)을 위해 시스템 음향 효과를 재생하는 방법을 알고 있습니까? Finder에서 파일을 이동할 때 사용하는 소리입니다. 나는 그렇게하기위한 API를 찾지 못했습니다. 누군가 그 사운드 파일의 위치를 ​​알고 있나? 나는 단지 시스템 알리미 소리 (개구리, 잠수함 등 ..)를 발견했다.복사, 붙여 넣기 및 삭제 작업을위한 시스템 사운드 효과

답변

4

SystemSounds

/System/Library/Components/CoreAudio.component/Contents/Resources/SystemSounds/ 위치에서 사용할 수 있습니다.

NSSound *systemSound = [[NSSound alloc] initWithContentsOfFile:@"/System/Library/Components/CoreAudio.component/Contents/Resources/SystemSounds/finder/move\ to\ trash.aif" byReference:YES]; 
if (systemSound) { 
    [systemSound play]; 
} 

/System/Library/Components/CoreAudio.component/Contents/Resources/CoreAudioAUUI.bundle/Contents/Resources 
+0

'System/Library/Components/CoreAudio.component/Contents/Resources /'에 SystemSounds 폴더 나 CoreAudioAUII 번들이 없습니다. 문자열이있는 .lproj 폴더와 다른 몇 개의 파일. 라이온을 사용하고 있습니까? – DrummerB

+1

'/ System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSounds'에서 찾았습니다. 감사! – DrummerB

+0

참고 :이 경우에는 메서드가 실행되지 않기 때문에 systemSound가 nil이 아닌지 확인하기 위해 if 문이 필요하지 않습니다. –

관련 문제