1 #import <AudioToolbox/AudioServices.h>
2 #import <Foundation/Foundation.h>
7 AudioObjectPropertyAddress propertyAddress = {
8 kAudioHardwarePropertyDefaultOutputDevice,
9 kAudioObjectPropertyScopeGlobal,
10 kAudioObjectPropertyElementMaster
12 AudioDeviceID deviceID = 0;
13 UInt32 dataSize =
sizeof(deviceID);
14 if(AudioHardwareServiceGetPropertyData(kAudioObjectSystemObject, &propertyAddress, 0, NULL, &dataSize, &deviceID)
15 != kAudioHardwareNoError){
19 AudioObjectPropertyAddress propertyAddress2 = {
20 kAudioDevicePropertyMute,
21 kAudioDevicePropertyScopeOutput,
22 kAudioObjectPropertyElementMaster
24 if(!AudioHardwareServiceHasProperty(deviceID, &propertyAddress2))
27 dataSize =
sizeof(state);
28 if(AudioHardwareServiceGetPropertyData(deviceID, &propertyAddress2, 0, NULL, &dataSize, &state)
29 != kAudioHardwareNoError)
35 [[NSProcessInfo processInfo] beginActivityWithOptions:NSActivityUserInitiatedAllowingIdleSystemSleep reason:@"Keyboard animation"];