// Automatically generated by clay-bindgen
// language: c

import libc.*;
import unix.*;
import cocoa.corefoundation.*;

private alias OpaquePointer = RawPointer;
private alias UnknownType = Int;
private alias AUnionType = Int;


record Struct_AudioValueRange (
    mMinimum : Double,
    mMaximum : Double,
);

alias AudioValueRange = Struct_AudioValueRange;

record Struct_AudioValueTranslation (
    mInputData : RawPointer,
    mInputDataSize : CULong,
    mOutputData : RawPointer,
    mOutputDataSize : CULong,
);

alias AudioValueTranslation = Struct_AudioValueTranslation;

record Struct_AudioBuffer (
    mNumberChannels : CULong,
    mDataByteSize : CULong,
    mData : RawPointer,
);

alias AudioBuffer = Struct_AudioBuffer;

record Struct_AudioBufferList (
    mNumberBuffers : CULong,
    mBuffers : Array[AudioBuffer,1],
);

alias AudioBufferList = Struct_AudioBufferList;

alias AudioSampleType = Float;

alias AudioUnitSampleType = Float;

record Struct_AudioStreamBasicDescription (
    mSampleRate : Double,
    mFormatID : CULong,
    mFormatFlags : CULong,
    mBytesPerPacket : CULong,
    mFramesPerPacket : CULong,
    mBytesPerFrame : CULong,
    mChannelsPerFrame : CULong,
    mBitsPerChannel : CULong,
    mReserved : CULong,
);

alias AudioStreamBasicDescription = Struct_AudioStreamBasicDescription;

alias kAudioStreamAnyRate = 0;

alias kAudioFormatLinearPCM = 1819304813;
alias kAudioFormatAC3 = 1633889587;
alias kAudioFormat60958AC3 = 1667326771;
alias kAudioFormatAppleIMA4 = 1768775988;
alias kAudioFormatMPEG4AAC = 1633772320;
alias kAudioFormatMPEG4CELP = 1667591280;
alias kAudioFormatMPEG4HVXC = 1752594531;
alias kAudioFormatMPEG4TwinVQ = 1953986161;
alias kAudioFormatMACE3 = 1296122675;
alias kAudioFormatMACE6 = 1296122678;
alias kAudioFormatULaw = 1970037111;
alias kAudioFormatALaw = 1634492791;
alias kAudioFormatQDesign = 1363430723;
alias kAudioFormatQDesign2 = 1363430706;
alias kAudioFormatQUALCOMM = 1365470320;
alias kAudioFormatMPEGLayer1 = 778924081;
alias kAudioFormatMPEGLayer2 = 778924082;
alias kAudioFormatMPEGLayer3 = 778924083;
alias kAudioFormatTimeCode = 1953066341;
alias kAudioFormatMIDIStream = 1835623529;
alias kAudioFormatParameterValueStream = 1634760307;
alias kAudioFormatAppleLossless = 1634492771;
alias kAudioFormatMPEG4AAC_HE = 1633772392;
alias kAudioFormatMPEG4AAC_LD = 1633772396;
alias kAudioFormatMPEG4AAC_HE_V2 = 1633772400;
alias kAudioFormatMPEG4AAC_Spatial = 1633772403;
alias kAudioFormatAMR = 1935764850;
alias kAudioFormatAudible = 1096107074;
alias kAudioFormatiLBC = 1768710755;
alias kAudioFormatDVIIntelIMA = 1836253201;
alias kAudioFormatMicrosoftGSM = 1836253233;
alias kAudioFormatAES3 = 1634038579;

alias kAudioFormatFlagIsFloat = 1;
alias kAudioFormatFlagIsBigEndian = 2;
alias kAudioFormatFlagIsSignedInteger = 4;
alias kAudioFormatFlagIsPacked = 8;
alias kAudioFormatFlagIsAlignedHigh = 16;
alias kAudioFormatFlagIsNonInterleaved = 32;
alias kAudioFormatFlagIsNonMixable = 64;
alias kAudioFormatFlagsAreAllClear = 2147483648;
alias kLinearPCMFormatFlagIsFloat = 1;
alias kLinearPCMFormatFlagIsBigEndian = 2;
alias kLinearPCMFormatFlagIsSignedInteger = 4;
alias kLinearPCMFormatFlagIsPacked = 8;
alias kLinearPCMFormatFlagIsAlignedHigh = 16;
alias kLinearPCMFormatFlagIsNonInterleaved = 32;
alias kLinearPCMFormatFlagIsNonMixable = 64;
alias kLinearPCMFormatFlagsSampleFractionShift = 7;
alias kLinearPCMFormatFlagsSampleFractionMask = 8064;
alias kLinearPCMFormatFlagsAreAllClear = 2147483648;
alias kAppleLosslessFormatFlag_16BitSourceData = 1;
alias kAppleLosslessFormatFlag_20BitSourceData = 2;
alias kAppleLosslessFormatFlag_24BitSourceData = 3;
alias kAppleLosslessFormatFlag_32BitSourceData = 4;

alias kAudioFormatFlagsNativeEndian = 0;
alias kAudioFormatFlagsCanonical = 9;
alias kAudioFormatFlagsAudioUnitCanonical = 41;
alias kAudioFormatFlagsNativeFloatPacked = 9;

record Struct_AudioStreamPacketDescription (
    mStartOffset : Int64,
    mVariableFramesInPacket : CULong,
    mDataByteSize : CULong,
);

alias AudioStreamPacketDescription = Struct_AudioStreamPacketDescription;

record Struct_SMPTETime (
    mSubframes : Short,
    mSubframeDivisor : Short,
    mCounter : CULong,
    mType : CULong,
    mFlags : CULong,
    mHours : Short,
    mMinutes : Short,
    mSeconds : Short,
    mFrames : Short,
);

alias SMPTETime = Struct_SMPTETime;

alias kSMPTETimeType24 = 0;
alias kSMPTETimeType25 = 1;
alias kSMPTETimeType30Drop = 2;
alias kSMPTETimeType30 = 3;
alias kSMPTETimeType2997 = 4;
alias kSMPTETimeType2997Drop = 5;
alias kSMPTETimeType60 = 6;
alias kSMPTETimeType5994 = 7;
alias kSMPTETimeType60Drop = 8;
alias kSMPTETimeType5994Drop = 9;
alias kSMPTETimeType50 = 10;
alias kSMPTETimeType2398 = 11;

alias kSMPTETimeValid = 1;
alias kSMPTETimeRunning = 2;

record Struct_AudioTimeStamp (
    mSampleTime : Double,
    mHostTime : UInt64,
    mRateScalar : Double,
    mWordClockTime : UInt64,
    mSMPTETime : SMPTETime,
    mFlags : CULong,
    mReserved : CULong,
);

alias AudioTimeStamp = Struct_AudioTimeStamp;

alias kAudioTimeStampSampleTimeValid = 1;
alias kAudioTimeStampHostTimeValid = 2;
alias kAudioTimeStampRateScalarValid = 4;
alias kAudioTimeStampWordClockTimeValid = 8;
alias kAudioTimeStampSMPTETimeValid = 16;

alias kAudioTimeStampSampleHostTimeValid = 3;

record Struct_AudioClassDescription (
    mType : CULong,
    mSubType : CULong,
    mManufacturer : CULong,
);

alias AudioClassDescription = Struct_AudioClassDescription;

alias AudioChannelLabel = CULong;

alias AudioChannelLayoutTag = CULong;

record Struct_AudioChannelDescription (
    mChannelLabel : CULong,
    mChannelFlags : CULong,
    mCoordinates : Array[Float,3],
);

alias AudioChannelDescription = Struct_AudioChannelDescription;

record Struct_AudioChannelLayout (
    mChannelLayoutTag : CULong,
    mChannelBitmap : CULong,
    mNumberChannelDescriptions : CULong,
    mChannelDescriptions : Array[AudioChannelDescription,1],
);

alias AudioChannelLayout = Struct_AudioChannelLayout;

alias kAudioChannelLabel_Unknown = 4294967295;
alias kAudioChannelLabel_Unused = 0;
alias kAudioChannelLabel_UseCoordinates = 100;
alias kAudioChannelLabel_Left = 1;
alias kAudioChannelLabel_Right = 2;
alias kAudioChannelLabel_Center = 3;
alias kAudioChannelLabel_LFEScreen = 4;
alias kAudioChannelLabel_LeftSurround = 5;
alias kAudioChannelLabel_RightSurround = 6;
alias kAudioChannelLabel_LeftCenter = 7;
alias kAudioChannelLabel_RightCenter = 8;
alias kAudioChannelLabel_CenterSurround = 9;
alias kAudioChannelLabel_LeftSurroundDirect = 10;
alias kAudioChannelLabel_RightSurroundDirect = 11;
alias kAudioChannelLabel_TopCenterSurround = 12;
alias kAudioChannelLabel_VerticalHeightLeft = 13;
alias kAudioChannelLabel_VerticalHeightCenter = 14;
alias kAudioChannelLabel_VerticalHeightRight = 15;
alias kAudioChannelLabel_TopBackLeft = 16;
alias kAudioChannelLabel_TopBackCenter = 17;
alias kAudioChannelLabel_TopBackRight = 18;
alias kAudioChannelLabel_RearSurroundLeft = 33;
alias kAudioChannelLabel_RearSurroundRight = 34;
alias kAudioChannelLabel_LeftWide = 35;
alias kAudioChannelLabel_RightWide = 36;
alias kAudioChannelLabel_LFE2 = 37;
alias kAudioChannelLabel_LeftTotal = 38;
alias kAudioChannelLabel_RightTotal = 39;
alias kAudioChannelLabel_HearingImpaired = 40;
alias kAudioChannelLabel_Narration = 41;
alias kAudioChannelLabel_Mono = 42;
alias kAudioChannelLabel_DialogCentricMix = 43;
alias kAudioChannelLabel_CenterSurroundDirect = 44;
alias kAudioChannelLabel_Haptic = 45;
alias kAudioChannelLabel_Ambisonic_W = 200;
alias kAudioChannelLabel_Ambisonic_X = 201;
alias kAudioChannelLabel_Ambisonic_Y = 202;
alias kAudioChannelLabel_Ambisonic_Z = 203;
alias kAudioChannelLabel_MS_Mid = 204;
alias kAudioChannelLabel_MS_Side = 205;
alias kAudioChannelLabel_XY_X = 206;
alias kAudioChannelLabel_XY_Y = 207;
alias kAudioChannelLabel_HeadphonesLeft = 301;
alias kAudioChannelLabel_HeadphonesRight = 302;
alias kAudioChannelLabel_ClickTrack = 304;
alias kAudioChannelLabel_ForeignLanguage = 305;
alias kAudioChannelLabel_Discrete = 400;
alias kAudioChannelLabel_Discrete_0 = 65536;
alias kAudioChannelLabel_Discrete_1 = 65537;
alias kAudioChannelLabel_Discrete_2 = 65538;
alias kAudioChannelLabel_Discrete_3 = 65539;
alias kAudioChannelLabel_Discrete_4 = 65540;
alias kAudioChannelLabel_Discrete_5 = 65541;
alias kAudioChannelLabel_Discrete_6 = 65542;
alias kAudioChannelLabel_Discrete_7 = 65543;
alias kAudioChannelLabel_Discrete_8 = 65544;
alias kAudioChannelLabel_Discrete_9 = 65545;
alias kAudioChannelLabel_Discrete_10 = 65546;
alias kAudioChannelLabel_Discrete_11 = 65547;
alias kAudioChannelLabel_Discrete_12 = 65548;
alias kAudioChannelLabel_Discrete_13 = 65549;
alias kAudioChannelLabel_Discrete_14 = 65550;
alias kAudioChannelLabel_Discrete_15 = 65551;
alias kAudioChannelLabel_Discrete_65535 = 131071;

alias kAudioChannelBit_Left = 1;
alias kAudioChannelBit_Right = 2;
alias kAudioChannelBit_Center = 4;
alias kAudioChannelBit_LFEScreen = 8;
alias kAudioChannelBit_LeftSurround = 16;
alias kAudioChannelBit_RightSurround = 32;
alias kAudioChannelBit_LeftCenter = 64;
alias kAudioChannelBit_RightCenter = 128;
alias kAudioChannelBit_CenterSurround = 256;
alias kAudioChannelBit_LeftSurroundDirect = 512;
alias kAudioChannelBit_RightSurroundDirect = 1024;
alias kAudioChannelBit_TopCenterSurround = 2048;
alias kAudioChannelBit_VerticalHeightLeft = 4096;
alias kAudioChannelBit_VerticalHeightCenter = 8192;
alias kAudioChannelBit_VerticalHeightRight = 16384;
alias kAudioChannelBit_TopBackLeft = 32768;
alias kAudioChannelBit_TopBackCenter = 65536;
alias kAudioChannelBit_TopBackRight = 131072;

alias kAudioChannelFlags_AllOff = 0;
alias kAudioChannelFlags_RectangularCoordinates = 1;
alias kAudioChannelFlags_SphericalCoordinates = 2;
alias kAudioChannelFlags_Meters = 4;

alias kAudioChannelCoordinates_LeftRight = 0;
alias kAudioChannelCoordinates_BackFront = 1;
alias kAudioChannelCoordinates_DownUp = 2;
alias kAudioChannelCoordinates_Azimuth = 0;
alias kAudioChannelCoordinates_Elevation = 1;
alias kAudioChannelCoordinates_Distance = 2;

alias kAudioChannelLayoutTag_UseChannelDescriptions = 0;
alias kAudioChannelLayoutTag_UseChannelBitmap = 65536;
alias kAudioChannelLayoutTag_Mono = 6553601;
alias kAudioChannelLayoutTag_Stereo = 6619138;
alias kAudioChannelLayoutTag_StereoHeadphones = 6684674;
alias kAudioChannelLayoutTag_MatrixStereo = 6750210;
alias kAudioChannelLayoutTag_MidSide = 6815746;
alias kAudioChannelLayoutTag_XY = 6881282;
alias kAudioChannelLayoutTag_Binaural = 6946818;
alias kAudioChannelLayoutTag_Ambisonic_B_Format = 7012356;
alias kAudioChannelLayoutTag_Quadraphonic = 7077892;
alias kAudioChannelLayoutTag_Pentagonal = 7143429;
alias kAudioChannelLayoutTag_Hexagonal = 7208966;
alias kAudioChannelLayoutTag_Octagonal = 7274504;
alias kAudioChannelLayoutTag_Cube = 7340040;
alias kAudioChannelLayoutTag_MPEG_1_0 = 6553601;
alias kAudioChannelLayoutTag_MPEG_2_0 = 6619138;
alias kAudioChannelLayoutTag_MPEG_3_0_A = 7405571;
alias kAudioChannelLayoutTag_MPEG_3_0_B = 7471107;
alias kAudioChannelLayoutTag_MPEG_4_0_A = 7536644;
alias kAudioChannelLayoutTag_MPEG_4_0_B = 7602180;
alias kAudioChannelLayoutTag_MPEG_5_0_A = 7667717;
alias kAudioChannelLayoutTag_MPEG_5_0_B = 7733253;
alias kAudioChannelLayoutTag_MPEG_5_0_C = 7798789;
alias kAudioChannelLayoutTag_MPEG_5_0_D = 7864325;
alias kAudioChannelLayoutTag_MPEG_5_1_A = 7929862;
alias kAudioChannelLayoutTag_MPEG_5_1_B = 7995398;
alias kAudioChannelLayoutTag_MPEG_5_1_C = 8060934;
alias kAudioChannelLayoutTag_MPEG_5_1_D = 8126470;
alias kAudioChannelLayoutTag_MPEG_6_1_A = 8192007;
alias kAudioChannelLayoutTag_MPEG_7_1_A = 8257544;
alias kAudioChannelLayoutTag_MPEG_7_1_B = 8323080;
alias kAudioChannelLayoutTag_MPEG_7_1_C = 8388616;
alias kAudioChannelLayoutTag_Emagic_Default_7_1 = 8454152;
alias kAudioChannelLayoutTag_SMPTE_DTV = 8519688;
alias kAudioChannelLayoutTag_ITU_1_0 = 6553601;
alias kAudioChannelLayoutTag_ITU_2_0 = 6619138;
alias kAudioChannelLayoutTag_ITU_2_1 = 8585219;
alias kAudioChannelLayoutTag_ITU_2_2 = 8650756;
alias kAudioChannelLayoutTag_ITU_3_0 = 7405571;
alias kAudioChannelLayoutTag_ITU_3_1 = 7536644;
alias kAudioChannelLayoutTag_ITU_3_2 = 7667717;
alias kAudioChannelLayoutTag_ITU_3_2_1 = 7929862;
alias kAudioChannelLayoutTag_ITU_3_4_1 = 8388616;
alias kAudioChannelLayoutTag_DVD_0 = 6553601;
alias kAudioChannelLayoutTag_DVD_1 = 6619138;
alias kAudioChannelLayoutTag_DVD_2 = 8585219;
alias kAudioChannelLayoutTag_DVD_3 = 8650756;
alias kAudioChannelLayoutTag_DVD_4 = 8716291;
alias kAudioChannelLayoutTag_DVD_5 = 8781828;
alias kAudioChannelLayoutTag_DVD_6 = 8847365;
alias kAudioChannelLayoutTag_DVD_7 = 7405571;
alias kAudioChannelLayoutTag_DVD_8 = 7536644;
alias kAudioChannelLayoutTag_DVD_9 = 7667717;
alias kAudioChannelLayoutTag_DVD_10 = 8912900;
alias kAudioChannelLayoutTag_DVD_11 = 8978437;
alias kAudioChannelLayoutTag_DVD_12 = 7929862;
alias kAudioChannelLayoutTag_DVD_13 = 7536644;
alias kAudioChannelLayoutTag_DVD_14 = 7667717;
alias kAudioChannelLayoutTag_DVD_15 = 8912900;
alias kAudioChannelLayoutTag_DVD_16 = 8978437;
alias kAudioChannelLayoutTag_DVD_17 = 7929862;
alias kAudioChannelLayoutTag_DVD_18 = 9043973;
alias kAudioChannelLayoutTag_DVD_19 = 7733253;
alias kAudioChannelLayoutTag_DVD_20 = 7995398;
alias kAudioChannelLayoutTag_AudioUnit_4 = 7077892;
alias kAudioChannelLayoutTag_AudioUnit_5 = 7143429;
alias kAudioChannelLayoutTag_AudioUnit_6 = 7208966;
alias kAudioChannelLayoutTag_AudioUnit_8 = 7274504;
alias kAudioChannelLayoutTag_AudioUnit_5_0 = 7733253;
alias kAudioChannelLayoutTag_AudioUnit_6_0 = 9109510;
alias kAudioChannelLayoutTag_AudioUnit_7_0 = 9175047;
alias kAudioChannelLayoutTag_AudioUnit_7_0_Front = 9699335;
alias kAudioChannelLayoutTag_AudioUnit_5_1 = 7929862;
alias kAudioChannelLayoutTag_AudioUnit_6_1 = 8192007;
alias kAudioChannelLayoutTag_AudioUnit_7_1 = 8388616;
alias kAudioChannelLayoutTag_AudioUnit_7_1_Front = 8257544;
alias kAudioChannelLayoutTag_AAC_3_0 = 7471107;
alias kAudioChannelLayoutTag_AAC_Quadraphonic = 7077892;
alias kAudioChannelLayoutTag_AAC_4_0 = 7602180;
alias kAudioChannelLayoutTag_AAC_5_0 = 7864325;
alias kAudioChannelLayoutTag_AAC_5_1 = 8126470;
alias kAudioChannelLayoutTag_AAC_6_0 = 9240582;
alias kAudioChannelLayoutTag_AAC_6_1 = 9306119;
alias kAudioChannelLayoutTag_AAC_7_0 = 9371655;
alias kAudioChannelLayoutTag_AAC_7_1 = 8323080;
alias kAudioChannelLayoutTag_AAC_Octagonal = 9437192;
alias kAudioChannelLayoutTag_TMH_10_2_std = 9502736;
alias kAudioChannelLayoutTag_TMH_10_2_full = 9568277;
alias kAudioChannelLayoutTag_AC3_1_0_1 = 9764866;
alias kAudioChannelLayoutTag_AC3_3_0 = 9830403;
alias kAudioChannelLayoutTag_AC3_3_1 = 9895940;
alias kAudioChannelLayoutTag_AC3_3_0_1 = 9961476;
alias kAudioChannelLayoutTag_AC3_2_1_1 = 10027012;
alias kAudioChannelLayoutTag_AC3_3_1_1 = 10092549;
alias kAudioChannelLayoutTag_DiscreteInOrder = 9633792;
alias kAudioChannelLayoutTag_Unknown = 4294901760;

alias kMPEG4Object_AAC_Main = 1;
alias kMPEG4Object_AAC_LC = 2;
alias kMPEG4Object_AAC_SSR = 3;
alias kMPEG4Object_AAC_LTP = 4;
alias kMPEG4Object_AAC_SBR = 5;
alias kMPEG4Object_AAC_Scalable = 6;
alias kMPEG4Object_TwinVQ = 7;
alias kMPEG4Object_CELP = 8;
alias kMPEG4Object_HVXC = 9;

alias kAudioHardwareNoError = 0;
alias kAudioHardwareNotRunningError = 1937010544;
alias kAudioHardwareUnspecifiedError = 2003329396;
alias kAudioHardwareUnknownPropertyError = 2003332927;
alias kAudioHardwareBadPropertySizeError = 561211770;
alias kAudioHardwareIllegalOperationError = 1852797029;
alias kAudioHardwareBadObjectError = 560947818;
alias kAudioHardwareBadDeviceError = 560227702;
alias kAudioHardwareBadStreamError = 561214578;
alias kAudioHardwareUnsupportedOperationError = 1970171760;
alias kAudioDeviceUnsupportedFormatError = 560226676;
alias kAudioDevicePermissionsError = 560492391;

alias AudioObjectPropertySelector = CULong;

alias AudioObjectPropertyScope = CULong;

alias AudioObjectPropertyElement = CULong;

record Struct_AudioObjectPropertyAddress (
    mSelector : CULong,
    mScope : CULong,
    mElement : CULong,
);

alias AudioObjectPropertyAddress = Struct_AudioObjectPropertyAddress;

alias kAudioObjectPropertySelectorWildcard = 707406378;
alias kAudioObjectPropertyScopeWildcard = 707406378;
alias kAudioObjectPropertyElementWildcard = 4294967295;
alias kAudioPropertyWildcardPropertyID = 707406378;
alias kAudioPropertyWildcardSection = 255;
alias kAudioPropertyWildcardChannel = 4294967295;

alias AudioClassID = CULong;

alias AudioObjectID = CULong;

alias AudioObjectPropertyListenerProc = CCodePointer[[CULong,CULong,Pointer[Struct_AudioObjectPropertyAddress],RawPointer],[CLong]];

alias kAudioObjectPropertyScopeGlobal = 1735159650;
alias kAudioObjectPropertyElementMaster = 0;
alias kAudioObjectClassID = 1634689642;
alias kAudioObjectClassIDWildcard = 707406378;
alias kAudioObjectUnknown = 0;

alias kAudioObjectPropertyClass = 1668047219;
alias kAudioObjectPropertyOwner = 1937007734;
alias kAudioObjectPropertyCreator = 1869638759;
alias kAudioObjectPropertyName = 1819173229;
alias kAudioObjectPropertyManufacturer = 1819107691;
alias kAudioObjectPropertyElementName = 1818454126;
alias kAudioObjectPropertyElementCategoryName = 1818452846;
alias kAudioObjectPropertyElementNumberName = 1818455662;
alias kAudioObjectPropertyOwnedObjects = 1870098020;
alias kAudioObjectPropertyListenerAdded = 1818850145;
alias kAudioObjectPropertyListenerRemoved = 1818850162;

external AudioObjectShow(
    inObjectID : CULong);

external AudioObjectHasProperty(
    inObjectID : CULong,
    inAddress : Pointer[AudioObjectPropertyAddress]) : CUChar;

external AudioObjectIsPropertySettable(
    inObjectID : CULong,
    inAddress : Pointer[AudioObjectPropertyAddress],
    outIsSettable : Pointer[CUChar]) : CLong;

external AudioObjectGetPropertyDataSize(
    inObjectID : CULong,
    inAddress : Pointer[AudioObjectPropertyAddress],
    inQualifierDataSize : CULong,
    inQualifierData : RawPointer,
    outDataSize : Pointer[CULong]) : CLong;

external AudioObjectGetPropertyData(
    inObjectID : CULong,
    inAddress : Pointer[AudioObjectPropertyAddress],
    inQualifierDataSize : CULong,
    inQualifierData : RawPointer,
    ioDataSize : Pointer[CULong],
    outData : RawPointer) : CLong;

external AudioObjectSetPropertyData(
    inObjectID : CULong,
    inAddress : Pointer[AudioObjectPropertyAddress],
    inQualifierDataSize : CULong,
    inQualifierData : RawPointer,
    inDataSize : CULong,
    inData : RawPointer) : CLong;

external AudioObjectAddPropertyListener(
    inObjectID : CULong,
    inAddress : Pointer[AudioObjectPropertyAddress],
    inListener : AudioObjectPropertyListenerProc,
    inClientData : RawPointer) : CLong;

external AudioObjectRemovePropertyListener(
    inObjectID : CULong,
    inAddress : Pointer[AudioObjectPropertyAddress],
    inListener : AudioObjectPropertyListenerProc,
    inClientData : RawPointer) : CLong;

alias kAudioControlClassID = 1633907820;
alias kAudioLevelControlClassID = 1818588780;
alias kAudioBooleanControlClassID = 1953458028;
alias kAudioSelectorControlClassID = 1936483188;
alias kAudioStereoPanControlClassID = 1936744814;

alias kAudioVolumeControlClassID = 1986817381;
alias kAudioLFEVolumeControlClassID = 1937072758;
alias kAudioBootChimeVolumeControlClassID = 1886544237;

alias kAudioMuteControlClassID = 1836414053;
alias kAudioSoloControlClassID = 1936682095;
alias kAudioJackControlClassID = 1784767339;
alias kAudioLFEMuteControlClassID = 1937072749;
alias kAudioISubOwnerControlClassID = 1635017576;

alias kAudioDataSourceControlClassID = 1685287523;
alias kAudioDataDestinationControlClassID = 1684370292;
alias kAudioClockSourceControlClassID = 1668047723;
alias kAudioLineLevelControlClassID = 1852601964;

alias kAudioControlPropertyScope = 1668506480;
alias kAudioControlPropertyElement = 1667591277;
alias kAudioControlPropertyVariant = 1668702578;

alias kAudioLevelControlPropertyScalarValue = 1818456950;
alias kAudioLevelControlPropertyDecibelValue = 1818453110;
alias kAudioLevelControlPropertyDecibelRange = 1818453106;
alias kAudioLevelControlPropertyConvertScalarToDecibels = 1818456932;
alias kAudioLevelControlPropertyConvertDecibelsToScalar = 1818453107;
alias kAudioLevelControlPropertyDecibelsToScalarTransferFunction = 1818457190;

alias kAudioLevelControlTranferFunctionLinear = 0;
alias kAudioLevelControlTranferFunction1Over3 = 1;
alias kAudioLevelControlTranferFunction1Over2 = 2;
alias kAudioLevelControlTranferFunction3Over4 = 3;
alias kAudioLevelControlTranferFunction3Over2 = 4;
alias kAudioLevelControlTranferFunction2Over1 = 5;
alias kAudioLevelControlTranferFunction3Over1 = 6;
alias kAudioLevelControlTranferFunction4Over1 = 7;
alias kAudioLevelControlTranferFunction5Over1 = 8;
alias kAudioLevelControlTranferFunction6Over1 = 9;
alias kAudioLevelControlTranferFunction7Over1 = 10;
alias kAudioLevelControlTranferFunction8Over1 = 11;
alias kAudioLevelControlTranferFunction9Over1 = 12;
alias kAudioLevelControlTranferFunction10Over1 = 13;
alias kAudioLevelControlTranferFunction11Over1 = 14;
alias kAudioLevelControlTranferFunction12Over1 = 15;

alias kAudioBooleanControlPropertyValue = 1650685548;

alias kAudioSelectorControlPropertyCurrentItem = 1935893353;
alias kAudioSelectorControlPropertyAvailableItems = 1935892841;
alias kAudioSelectorControlPropertyItemName = 1935894894;

alias kAudioClockSourceControlPropertyItemKind = 1668049771;

alias kAudioClockSourceItemKindInternal = 1768846368;

alias kAudioStereoPanControlPropertyValue = 1936745334;
alias kAudioStereoPanControlPropertyPanningChannels = 1936745315;

alias AudioHardwarePropertyID = CULong;

alias AudioHardwarePropertyListenerProc = CCodePointer[[CULong,RawPointer],[CLong]];

alias kAudioSystemObjectClassID = 1634957683;
alias kAudioObjectSystemObject = 1;

alias kAudioHardwarePropertyProcessIsMaster = 1835103092;
alias kAudioHardwarePropertyIsInitingOrExiting = 1768845172;
alias kAudioHardwarePropertyUserIDChanged = 1702193508;
alias kAudioHardwarePropertyDevices = 1684370979;
alias kAudioHardwarePropertyDefaultInputDevice = 1682533920;
alias kAudioHardwarePropertyDefaultOutputDevice = 1682929012;
alias kAudioHardwarePropertyDefaultSystemOutputDevice = 1934587252;
alias kAudioHardwarePropertyDeviceForUID = 1685416292;
alias kAudioHardwarePropertyProcessIsAudible = 1886221684;
alias kAudioHardwarePropertySleepingIsAllowed = 1936483696;
alias kAudioHardwarePropertyUnloadingIsAllowed = 1970170980;
alias kAudioHardwarePropertyHogModeIsAllowed = 1752131442;
alias kAudioHardwarePropertyRunLoop = 1919839344;
alias kAudioHardwarePropertyPlugInForBundleID = 1885954665;
alias kAudioHardwarePropertyUserSessionIsActiveOrHeadless = 1970496882;
alias kAudioHardwarePropertyMixStereoToMono = 1937010031;

alias kAudioHardwarePropertyBootChimeVolumeScalar = 1650620019;
alias kAudioHardwarePropertyBootChimeVolumeDecibels = 1650620004;
alias kAudioHardwarePropertyBootChimeVolumeRangeDecibels = 1650615331;
alias kAudioHardwarePropertyBootChimeVolumeScalarToDecibels = 1651913316;
alias kAudioHardwarePropertyBootChimeVolumeDecibelsToScalar = 1650733686;
alias kAudioHardwarePropertyBootChimeVolumeDecibelsToScalarTransferFunction = 1651930214;

external AudioHardwareAddRunLoopSource(
    inRunLoopSource : CFRunLoopSourceRef) : CLong;

external AudioHardwareRemoveRunLoopSource(
    inRunLoopSource : CFRunLoopSourceRef) : CLong;

external AudioHardwareUnload() : CLong;

external AudioHardwareGetPropertyInfo(
    inPropertyID : CULong,
    outSize : Pointer[CULong],
    outWritable : Pointer[CUChar]) : CLong;

external AudioHardwareGetProperty(
    inPropertyID : CULong,
    ioPropertyDataSize : Pointer[CULong],
    outPropertyData : RawPointer) : CLong;

external AudioHardwareSetProperty(
    inPropertyID : CULong,
    inPropertyDataSize : CULong,
    inPropertyData : RawPointer) : CLong;

external AudioHardwareAddPropertyListener(
    inPropertyID : CULong,
    inProc : AudioHardwarePropertyListenerProc,
    inClientData : RawPointer) : CLong;

external AudioHardwareRemovePropertyListener(
    inPropertyID : CULong,
    inProc : AudioHardwarePropertyListenerProc) : CLong;

alias kAudioPlugInClassID = 1634757735;

alias kAudioPlugInPropertyBundleID = 1885956452;
alias kAudioPlugInCreateAggregateDevice = 1667327847;
alias kAudioPlugInDestroyAggregateDevice = 1684105063;

alias AudioDeviceID = CULong;

alias AudioDevicePropertyID = CULong;

alias AudioDeviceIOProc = CCodePointer[[CULong,Pointer[Struct_AudioTimeStamp],Pointer[Struct_AudioBufferList],Pointer[Struct_AudioTimeStamp],Pointer[Struct_AudioBufferList],Pointer[Struct_AudioTimeStamp],RawPointer],[CLong]];

alias AudioDeviceIOProcID = AudioDeviceIOProc;

record Struct_AudioHardwareIOProcStreamUsage (
    mIOProc : RawPointer,
    mNumberStreams : CULong,
    mStreamIsOn : Array[CULong,1],
);

alias AudioHardwareIOProcStreamUsage = Struct_AudioHardwareIOProcStreamUsage;

alias AudioDevicePropertyListenerProc = CCodePointer[[CULong,CULong,CUChar,CULong,RawPointer],[CLong]];

alias kAudioDevicePropertyScopeInput = 1768845428;
alias kAudioDevicePropertyScopeOutput = 1869968496;
alias kAudioDevicePropertyScopePlayThrough = 1886679669;
alias kAudioDeviceClassID = 1633969526;
alias kAudioDeviceUnknown = 0;

alias kAudioDeviceStartTimeIsInputFlag = 1;
alias kAudioDeviceStartTimeDontConsultDeviceFlag = 2;
alias kAudioDeviceStartTimeDontConsultHALFlag = 4;

alias kAudioDeviceTransportTypeUnknown = 0;
alias kAudioDeviceTransportTypeBuiltIn = 1651274862;
alias kAudioDeviceTransportTypeAggregate = 1735554416;
alias kAudioDeviceTransportTypeAutoAggregate = 1718055536;
alias kAudioDeviceTransportTypeVirtual = 1986622068;
alias kAudioDeviceTransportTypePCI = 1885563168;
alias kAudioDeviceTransportTypeUSB = 1970496032;
alias kAudioDeviceTransportTypeFireWire = 825440564;
alias kAudioDeviceTransportTypeBluetooth = 1651275109;

alias kAudioDevicePropertyPlugIn = 1886156135;
alias kAudioDevicePropertyConfigurationApplication = 1667330160;
alias kAudioDevicePropertyDeviceUID = 1969841184;
alias kAudioDevicePropertyModelUID = 1836411236;
alias kAudioDevicePropertyTransportType = 1953653102;
alias kAudioDevicePropertyRelatedDevices = 1634429294;
alias kAudioDevicePropertyClockDomain = 1668049764;
alias kAudioDevicePropertyDeviceIsAlive = 1818850926;
alias kAudioDevicePropertyDeviceHasChanged = 1684629094;
alias kAudioDevicePropertyDeviceIsRunning = 1735354734;
alias kAudioDevicePropertyDeviceIsRunningSomewhere = 1735356005;
alias kAudioDevicePropertyDeviceCanBeDefaultDevice = 1684434036;
alias kAudioDevicePropertyDeviceCanBeDefaultSystemDevice = 1936092276;
alias kAudioDeviceProcessorOverload = 1870030194;
alias kAudioDevicePropertyHogMode = 1869180523;
alias kAudioDevicePropertyLatency = 1819569763;
alias kAudioDevicePropertyBufferFrameSize = 1718839674;
alias kAudioDevicePropertyBufferFrameSizeRange = 1718843939;
alias kAudioDevicePropertyUsesVariableBufferFrameSizes = 1986425722;
alias kAudioDevicePropertyStreams = 1937009955;
alias kAudioDevicePropertySafetyOffset = 1935763060;
alias kAudioDevicePropertyIOCycleUsage = 1852012899;
alias kAudioDevicePropertyStreamConfiguration = 1936482681;
alias kAudioDevicePropertyIOProcStreamUsage = 1937077093;
alias kAudioDevicePropertyPreferredChannelsForStereo = 1684236338;
alias kAudioDevicePropertyPreferredChannelLayout = 1936879204;
alias kAudioDevicePropertyNominalSampleRate = 1853059700;
alias kAudioDevicePropertyAvailableNominalSampleRates = 1853059619;
alias kAudioDevicePropertyActualSampleRate = 1634955892;
alias kAudioDevicePropertyIcon = 1768124270;
alias kAudioDevicePropertyIsHidden = 1751737454;

alias kAudioDevicePropertyJackIsConnected = 1784767339;
alias kAudioDevicePropertyVolumeScalar = 1987013741;
alias kAudioDevicePropertyVolumeDecibels = 1987013732;
alias kAudioDevicePropertyVolumeRangeDecibels = 1986290211;
alias kAudioDevicePropertyVolumeScalarToDecibels = 1983013986;
alias kAudioDevicePropertyVolumeDecibelsToScalar = 1684157046;
alias kAudioDevicePropertyVolumeDecibelsToScalarTransferFunction = 1986229350;
alias kAudioDevicePropertyStereoPan = 1936744814;
alias kAudioDevicePropertyStereoPanChannels = 1936748067;
alias kAudioDevicePropertyMute = 1836414053;
alias kAudioDevicePropertySolo = 1936682095;
alias kAudioDevicePropertyDataSource = 1936945763;
alias kAudioDevicePropertyDataSources = 1936941859;
alias kAudioDevicePropertyDataSourceNameForIDCFString = 1819501422;
alias kAudioDevicePropertyClockSource = 1668510307;
alias kAudioDevicePropertyClockSources = 1668506403;
alias kAudioDevicePropertyClockSourceNameForIDCFString = 1818456942;
alias kAudioDevicePropertyClockSourceKindForID = 1668506475;
alias kAudioDevicePropertyPlayThru = 1953002101;
alias kAudioDevicePropertyPlayThruSolo = 1953002099;
alias kAudioDevicePropertyPlayThruVolumeScalar = 1836479331;
alias kAudioDevicePropertyPlayThruVolumeDecibels = 1836475490;
alias kAudioDevicePropertyPlayThruVolumeRangeDecibels = 1836475427;
alias kAudioDevicePropertyPlayThruVolumeScalarToDecibels = 1836462692;
alias kAudioDevicePropertyPlayThruVolumeDecibelsToScalar = 1836462707;
alias kAudioDevicePropertyPlayThruVolumeDecibelsToScalarTransferFunction = 1836479590;
alias kAudioDevicePropertyPlayThruStereoPan = 1836281966;
alias kAudioDevicePropertyPlayThruStereoPanChannels = 1836281891;
alias kAudioDevicePropertyPlayThruDestination = 1835295859;
alias kAudioDevicePropertyPlayThruDestinations = 1835295779;
alias kAudioDevicePropertyPlayThruDestinationNameForIDCFString = 1835295843;
alias kAudioDevicePropertyChannelNominalLineLevel = 1852601964;
alias kAudioDevicePropertyChannelNominalLineLevels = 1852601891;
alias kAudioDevicePropertyChannelNominalLineLevelNameForIDCFString = 1818455660;
alias kAudioDevicePropertyDriverShouldOwniSub = 1769174370;
alias kAudioDevicePropertySubVolumeScalar = 1937140845;
alias kAudioDevicePropertySubVolumeDecibels = 1937140836;
alias kAudioDevicePropertySubVolumeRangeDecibels = 1937138723;
alias kAudioDevicePropertySubVolumeScalarToDecibels = 1937125988;
alias kAudioDevicePropertySubVolumeDecibelsToScalar = 1935946358;
alias kAudioDevicePropertySubVolumeDecibelsToScalarTransferFunction = 1937142886;
alias kAudioDevicePropertySubMute = 1936553332;

alias kAudioDevicePropertyDeviceName = 1851878757;
alias kAudioDevicePropertyDeviceNameCFString = 1819173229;
alias kAudioDevicePropertyDeviceManufacturer = 1835101042;
alias kAudioDevicePropertyDeviceManufacturerCFString = 1819107691;
alias kAudioDevicePropertyRegisterBufferList = 1919055206;
alias kAudioDevicePropertyBufferSize = 1651730810;
alias kAudioDevicePropertyBufferSizeRange = 1651735075;
alias kAudioDevicePropertyChannelName = 1667788397;
alias kAudioDevicePropertyChannelNameCFString = 1818454126;
alias kAudioDevicePropertyChannelCategoryName = 1667460717;
alias kAudioDevicePropertyChannelCategoryNameCFString = 1818452846;
alias kAudioDevicePropertyChannelNumberName = 1668181613;
alias kAudioDevicePropertyChannelNumberNameCFString = 1818455662;
alias kAudioDevicePropertySupportsMixing = 1835628607;
alias kAudioDevicePropertyStreamFormat = 1936092532;
alias kAudioDevicePropertyStreamFormats = 1936092451;
alias kAudioDevicePropertyStreamFormatSupported = 1936092479;
alias kAudioDevicePropertyStreamFormatMatch = 1936092525;
alias kAudioDevicePropertyDataSourceNameForID = 1936941934;
alias kAudioDevicePropertyClockSourceNameForID = 1668506478;
alias kAudioDevicePropertyPlayThruDestinationNameForID = 1835295854;
alias kAudioDevicePropertyChannelNominalLineLevelNameForID = 1668181110;

external AudioDeviceCreateIOProcID(
    inDevice : CULong,
    inProc : AudioDeviceIOProc,
    inClientData : RawPointer,
    outIOProcID : Pointer[AudioDeviceIOProcID]) : CLong;

external AudioDeviceDestroyIOProcID(
    inDevice : CULong,
    inIOProcID : AudioDeviceIOProcID) : CLong;

external AudioDeviceAddIOProc(
    inDevice : CULong,
    inProc : AudioDeviceIOProc,
    inClientData : RawPointer) : CLong;

external AudioDeviceRemoveIOProc(
    inDevice : CULong,
    inProc : AudioDeviceIOProc) : CLong;

external AudioDeviceStart(
    inDevice : CULong,
    inProcID : AudioDeviceIOProcID) : CLong;

external AudioDeviceStartAtTime(
    inDevice : CULong,
    inProcID : AudioDeviceIOProcID,
    ioRequestedStartTime : Pointer[AudioTimeStamp],
    inFlags : CULong) : CLong;

external AudioDeviceStop(
    inDevice : CULong,
    inProcID : AudioDeviceIOProcID) : CLong;

external AudioDeviceRead(
    inDevice : CULong,
    inStartTime : Pointer[AudioTimeStamp],
    outData : Pointer[AudioBufferList]) : CLong;

external AudioDeviceGetCurrentTime(
    inDevice : CULong,
    outTime : Pointer[AudioTimeStamp]) : CLong;

external AudioDeviceTranslateTime(
    inDevice : CULong,
    inTime : Pointer[AudioTimeStamp],
    outTime : Pointer[AudioTimeStamp]) : CLong;

external AudioDeviceGetNearestStartTime(
    inDevice : CULong,
    ioRequestedStartTime : Pointer[AudioTimeStamp],
    inFlags : CULong) : CLong;

external AudioDeviceGetPropertyInfo(
    inDevice : CULong,
    inChannel : CULong,
    isInput : CUChar,
    inPropertyID : CULong,
    outSize : Pointer[CULong],
    outWritable : Pointer[CUChar]) : CLong;

external AudioDeviceGetProperty(
    inDevice : CULong,
    inChannel : CULong,
    isInput : CUChar,
    inPropertyID : CULong,
    ioPropertyDataSize : Pointer[CULong],
    outPropertyData : RawPointer) : CLong;

external AudioDeviceSetProperty(
    inDevice : CULong,
    inWhen : Pointer[AudioTimeStamp],
    inChannel : CULong,
    isInput : CUChar,
    inPropertyID : CULong,
    inPropertyDataSize : CULong,
    inPropertyData : RawPointer) : CLong;

external AudioDeviceAddPropertyListener(
    inDevice : CULong,
    inChannel : CULong,
    isInput : CUChar,
    inPropertyID : CULong,
    inProc : AudioDevicePropertyListenerProc,
    inClientData : RawPointer) : CLong;

external AudioDeviceRemovePropertyListener(
    inDevice : CULong,
    inChannel : CULong,
    isInput : CUChar,
    inPropertyID : CULong,
    inProc : AudioDevicePropertyListenerProc) : CLong;

alias AudioStreamID = CULong;

record Struct_AudioStreamRangedDescription (
    mFormat : AudioStreamBasicDescription,
    mSampleRateRange : AudioValueRange,
);

alias AudioStreamRangedDescription = Struct_AudioStreamRangedDescription;

alias AudioStreamPropertyListenerProc = CCodePointer[[CULong,CULong,CULong,RawPointer],[CLong]];

alias kAudioStreamClassID = 1634956402;
alias kAudioStreamUnknown = 0;

alias kAudioStreamTerminalTypeUnknown = 0;
alias kAudioStreamTerminalTypeLine = 1818848869;
alias kAudioStreamTerminalTypeDigitalAudioInterface = 1936745574;
alias kAudioStreamTerminalTypeSpeaker = 1936747378;
alias kAudioStreamTerminalTypeHeadphones = 1751412840;
alias kAudioStreamTerminalTypeLFESpeaker = 1818649971;
alias kAudioStreamTerminalTypeReceiverSpeaker = 1920168043;
alias kAudioStreamTerminalTypeMicrophone = 1835623282;
alias kAudioStreamTerminalTypeHeadsetMicrophone = 1752000867;
alias kAudioStreamTerminalTypeReceiverMicrophone = 1919773027;
alias kAudioStreamTerminalTypeTTY = 1953790303;

alias kAudioStreamPropertyDirection = 1935960434;
alias kAudioStreamPropertyTerminalType = 1952805485;
alias kAudioStreamPropertyStartingChannel = 1935894638;
alias kAudioStreamPropertyLatency = 1819569763;
alias kAudioStreamPropertyVirtualFormat = 1936092532;
alias kAudioStreamPropertyAvailableVirtualFormats = 1936092513;
alias kAudioStreamPropertyPhysicalFormat = 1885762592;
alias kAudioStreamPropertyAvailablePhysicalFormats = 1885762657;

alias kAudioStreamPropertyOwningDevice = 1937007734;
alias kAudioStreamPropertyPhysicalFormats = 1885762595;
alias kAudioStreamPropertyPhysicalFormatSupported = 1885762623;
alias kAudioStreamPropertyPhysicalFormatMatch = 1885762669;

external AudioStreamGetPropertyInfo(
    inStream : CULong,
    inChannel : CULong,
    inPropertyID : CULong,
    outSize : Pointer[CULong],
    outWritable : Pointer[CUChar]) : CLong;

external AudioStreamGetProperty(
    inStream : CULong,
    inChannel : CULong,
    inPropertyID : CULong,
    ioPropertyDataSize : Pointer[CULong],
    outPropertyData : RawPointer) : CLong;

external AudioStreamSetProperty(
    inStream : CULong,
    inWhen : Pointer[AudioTimeStamp],
    inChannel : CULong,
    inPropertyID : CULong,
    inPropertyDataSize : CULong,
    inPropertyData : RawPointer) : CLong;

external AudioStreamAddPropertyListener(
    inStream : CULong,
    inChannel : CULong,
    inPropertyID : CULong,
    inProc : AudioStreamPropertyListenerProc,
    inClientData : RawPointer) : CLong;

external AudioStreamRemovePropertyListener(
    inStream : CULong,
    inChannel : CULong,
    inPropertyID : CULong,
    inProc : AudioStreamPropertyListenerProc) : CLong;

alias kAudioAggregateDeviceClassID = 1633773415;

alias kAudioAggregateDevicePropertyFullSubDeviceList = 1735554416;
alias kAudioAggregateDevicePropertyActiveSubDeviceList = 1634169456;
alias kAudioAggregateDevicePropertyComposition = 1633906541;

alias kAudioAggregateDevicePropertyMasterSubDevice = 1634562932;

alias kAudioSubDeviceClassID = 1634956642;

alias kAudioSubDeviceDriftCompensationMinQuality = 0;
alias kAudioSubDeviceDriftCompensationLowQuality = 32;
alias kAudioSubDeviceDriftCompensationMediumQuality = 64;
alias kAudioSubDeviceDriftCompensationHighQuality = 96;
alias kAudioSubDeviceDriftCompensationMaxQuality = 127;

alias kAudioSubDevicePropertyExtraLatency = 2020373603;
alias kAudioSubDevicePropertyDriftCompensation = 1685218932;
alias kAudioSubDevicePropertyDriftCompensationQuality = 1685218929;

external AudioGetCurrentHostTime() : UInt64;

external AudioGetHostClockFrequency() : Double;

external AudioGetHostClockMinimumTimeDelta() : CULong;

external AudioConvertHostTimeToNanos(
    inHostTime : UInt64) : UInt64;

external AudioConvertNanosToHostTime(
    inNanos : UInt64) : UInt64;
