ADC Home > Reference Library > Reference > Hardware & Drivers > I/O Kit Framework Reference

 


IOAudioTypes.h

Include Path:

<IOKit/audio/IOAudioTypes.h>

Path:

/System/Library/Frameworks/IOKit.framework/Versions/A/Headers/audio/IOAudioTypes.h

Includes:
<libkern/OSTypes.h>
<mach/message.h>
<device/device_types.h>
<IOKit/ndrvsupport/IOMacOSTypes.h>

Overview

This header includes data types used when communicating with the I/O Kit Audio Engine. Developers are encouraged to use the Core Audio HAL rather than attempting to control an audio device directly.

For more information on the Core Audio HAL, download the Core Audio SDK from http://developer.apple.com/audio/.



Typedefs


IOAudioControlCalls


The set of constants passed to IOAudioControlUserClient::getExternalMethodForIndex() when making calls from the IOAudioFamily user client code.

typedef enum _IOAudioControlCalls { 
    kIOAudioControlCallSetValue = 0, 
    kIOAudioControlCallGetValue = 1 
} IOAudioControlCalls;  
Constants
kIOAudioControlCallSetValue

Used to set the value of an IOAudioControl.

kIOAudioControlCallGetValue

Used to get the value of an IOAudioControl.


IOAudioControlNotifications


The set of constants passed in the type field of IOAudioControlUserClient::registerNotificationPort().

typedef enum _IOAudioControlNotifications { 
    kIOAudioControlValueChangeNotification = 0, 
    kIOAudioControlRangeChangeNotification = 1 
} IOAudioControlNotifications;  
Constants
kIOAudioControlValueChangeNotification

Used to request value change notifications.

kIOAudioControlRangeChangeNotification

Used to request range change notifications.


IOAudioEngineCalls


The set of constants passed to IOAudioEngineUserClient::getExternalMethodForIndex() when making calls from the IOAudioFamily user client code.

typedef enum _IOAudioEngineCalls { 
    kIOAudioEngineCallRegisterClientBuffer = 0, 
    kIOAudioEngineCallUnregisterClientBuffer = 1, 
    kIOAudioEngineCallGetConnectionID = 2, 
    kIOAudioEngineCallStart = 3, 
    kIOAudioEngineCallStop = 4, 
    kIOAudioEngineCallGetNearestStartTime = 5 
} IOAudioEngineCalls;  


IOAudioEngineMemory


Used to identify the type of memory requested by a client process to be mapped into its process space

typedef enum _IOAudioEngineMemory { 
    kIOAudioStatusBuffer = 0, 
    kIOAudioSampleBuffer = 1, 
    kIOAudioMixBuffer = 2, 
    kIOAudioBytesInInputBuffer = 3, 
    kIOAudioBytesInOutputBuffer = 4 
} IOAudioEngineMemory;  
Constants
kIOAudioSampleBuffer

This requests the IOAudioEngine's sample buffer

kIOAudioStatusBuffer

This requests the IOAudioEngine's status buffer. It's type is IOAudioEngineStatus.

kIOAudioMixBuffer

This requests the IOAudioEngine's mix buffer

Discussion

This is the parameter to the type field of IOMapMemory when called on an IOAudioEngine. This is only intended for use by the Audio Device API library.


IOAudioEngineState


Represents the state of an IOAudioEngine

typedef enum _IOAudioEngineState { 
    kIOAudioEngineStopped = 0, 
    kIOAudioEngineRunning = 1, 
    kIOAudioEnginePaused = 2, 
    kIOAudioEngineResumed = 3 
} IOAudioEngineState;  
Constants
kIOAudioEngineRunning

The IOAudioEngine is currently running - it is transferring data to or from the device.

kIOAudioEngineStopped

The IOAudioEngine is currently stopped - no activity is occurring.


IOAudioEngineStatus


Shared-memory structure giving audio engine status

typedef struct _IOAudioEngineStatus { 
    UInt32 fVersion; 
    volatile UInt32 fCurrentLoopCount; 
    volatile AbsoluteTime fLastLoopTime; 
    volatile UInt32 fEraseHeadSampleFrame; 
} IOAudioEngineStatus;  
Fields
fVersion

Indicates version of this structure

fCurrentLoopCount

Number of times around the ring buffer since the audio engine started

fLastLoopTime

Timestamp of the last time the ring buffer wrapped

fEraseHeadSampleFrame

Location of the erase head in sample frames - erased up to but not including the given sample frame


IOAudioNotificationMessage


Used in the mach message for IOAudio notifications.

typedef struct _IOAudioNotificationMessage { 
    mach_msg_header_t messageHeader; 
    UInt32 type; 
    UInt32 ref; 
    void *sender; 
} IOAudioNotificationMessage;  
Fields
messageHeader

Standard mach message header

ref

The param passed to registerNotificationPort() in refCon.


IOAudioSMPTETime


A structure for holding a SMPTE time.

See Also:

SMPTETime

typedef struct _IOAudioSMPTETime { 
    SInt16 fSubframes; 
    SInt16 fSubframeDivisor; 
    UInt32 fCounter; 
    UInt32 fType; 
    UInt32 fFlags; 
    SInt16 fHours; 
    SInt16 fMinutes; 
    SInt16 fSeconds; 
    SInt16 fFrames;  
} IOAudioSMPTETime;  
Fields
fSubframes

The number of subframes in the full message.

fSubframeDivisor

The number of subframes per frame (typically 80).

fCounter

The total number of messages received.

fType

The kind of SMPTE time using the SMPTE time type constants.

fFlags

A set of flags that indicate the SMPTE state.

fHours

The number of hourse in the full message.

fMinutes

The number of minutes in the full message.

fSeconds

The number of seconds in the full message.

fFrames

The number of frames in the full message.


IOAudioStreamDirection


Represents the direction of an IOAudioStream

typedef enum _IOAudioStreamDirection { 
    kIOAudioStreamDirectionOutput = 0, 
    kIOAudioStreamDirectionInput = 1 
} IOAudioStreamDirection;  
Constants
kIOAudioStreamDirectionOutput

Output buffer

kIOAudioStreamDirectionInput

Input buffer


SMPTETime


A structure for holding a SMPTE time.

See Also:

IOAudioSMPTETime

typedef struct _IOAudioSMPTETime { 
    SInt16 fSubframes; 
    SInt16 fSubframeDivisor; 
    UInt32 fCounter; 
    UInt32 fType; 
    UInt32 fFlags; 
    SInt16 fHours; 
    SInt16 fMinutes; 
    SInt16 fSeconds; 
    SInt16 fFrames;  
} IOAudioSMPTETime;  
Fields
fSubframes

The number of subframes in the full message.

fSubframeDivisor

The number of subframes per frame (typically 80).

fCounter

The total number of messages received.

fType

The kind of SMPTE time using the SMPTE time type constants.

fFlags

A set of flags that indicate the SMPTE state.

fHours

The number of hourse in the full message.

fMinutes

The number of minutes in the full message.

fSeconds

The number of seconds in the full message.

fFrames

The number of frames in the full message.

#defines


kIOAudioControlNumCalls


#define kIOAudioControlNumCalls 2 
Discussion
The number of elements in the IOAudioControlCalls enum.


kIOAudioEngineDefaultMixBufferSampleSize


#define kIOAudioEngineDefaultMixBufferSampleSize sizeof(float) 


kIOAudioEngineNumCalls


#define kIOAudioEngineNumCalls 6 
Discussion
The number of elements in the IOAudioEngineCalls enum.


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.

 

Last Updated: 2009-02-23