public final class AudioToolbox
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static int |
AudioCodecAppendInputBufferList(AudioComponentInstance inCodec,
AudioBufferList inBufferList,
org.moe.natj.general.ptr.IntPtr ioNumberPackets,
AudioStreamPacketDescription inPacketDescription,
org.moe.natj.general.ptr.IntPtr outBytesConsumed) |
static int |
AudioCodecAppendInputData(AudioComponentInstance inCodec,
org.moe.natj.general.ptr.ConstVoidPtr inInputData,
org.moe.natj.general.ptr.IntPtr ioInputDataByteSize,
org.moe.natj.general.ptr.IntPtr ioNumberPackets,
AudioStreamPacketDescription inPacketDescription)
[@function] AudioCodecAppendInputData
|
static int |
AudioCodecGetProperty(AudioComponentInstance inCodec,
int inPropertyID,
org.moe.natj.general.ptr.IntPtr ioPropertyDataSize,
org.moe.natj.general.ptr.VoidPtr outPropertyData)
[@function] AudioCodecGetProperty
|
static int |
AudioCodecGetPropertyInfo(AudioComponentInstance inCodec,
int inPropertyID,
org.moe.natj.general.ptr.IntPtr outSize,
org.moe.natj.general.ptr.BytePtr outWritable)
[@function] AudioCodecGetPropertyInfo
|
static int |
AudioCodecInitialize(AudioComponentInstance inCodec,
AudioStreamBasicDescription inInputFormat,
AudioStreamBasicDescription inOutputFormat,
org.moe.natj.general.ptr.ConstVoidPtr inMagicCookie,
int inMagicCookieByteSize)
[@function] AudioCodecInitialize
|
static int |
AudioCodecProduceOutputBufferList(AudioComponentInstance inCodec,
AudioBufferList ioBufferList,
org.moe.natj.general.ptr.IntPtr ioNumberPackets,
AudioStreamPacketDescription outPacketDescription,
org.moe.natj.general.ptr.IntPtr outStatus) |
static int |
AudioCodecProduceOutputPackets(AudioComponentInstance inCodec,
org.moe.natj.general.ptr.VoidPtr outOutputData,
org.moe.natj.general.ptr.IntPtr ioOutputDataByteSize,
org.moe.natj.general.ptr.IntPtr ioNumberPackets,
AudioStreamPacketDescription outPacketDescription,
org.moe.natj.general.ptr.IntPtr outStatus)
[@function] AudioCodecProduceOutputPackets
|
static int |
AudioCodecReset(AudioComponentInstance inCodec)
[@function] AudioCodecReset
|
static int |
AudioCodecSetProperty(AudioComponentInstance inCodec,
int inPropertyID,
int inPropertyDataSize,
org.moe.natj.general.ptr.ConstVoidPtr inPropertyData)
[@function] AudioCodecSetProperty
|
static int |
AudioCodecUninitialize(AudioComponentInstance inCodec)
[@function] AudioCodecUninitialize
|
static UIImage |
AudioComponentCopyIcon(AudioComponent comp)
[@function] AudioComponentCopyIcon
|
static int |
AudioComponentCopyName(AudioComponent inComponent,
org.moe.natj.general.ptr.Ptr<CFStringRef> outName)
[@function] AudioComponentCopyName
|
static int |
AudioComponentCount(AudioComponentDescription inDesc)
[@function] AudioComponentCount
|
static AudioComponent |
AudioComponentFindNext(AudioComponent inComponent,
AudioComponentDescription inDesc)
[@function] AudioComponentFindNext
|
static int |
AudioComponentGetDescription(AudioComponent inComponent,
AudioComponentDescription outDesc)
[@function] AudioComponentGetDescription
|
static UIImage |
AudioComponentGetIcon(AudioComponent comp,
float desiredPointSize) |
static double |
AudioComponentGetLastActiveTime(AudioComponent comp)
[@function] AudioComponentGetLastActiveTime
|
static int |
AudioComponentGetVersion(AudioComponent inComponent,
org.moe.natj.general.ptr.IntPtr outVersion)
[@function] AudioComponentGetVersion
|
static byte |
AudioComponentInstanceCanDo(AudioComponentInstance inInstance,
short inSelectorID)
[@function] AudioComponentInstanceCanDo
|
static int |
AudioComponentInstanceDispose(AudioComponentInstance inInstance)
[@function] AudioComponentInstanceDispose
|
static AudioComponent |
AudioComponentInstanceGetComponent(AudioComponentInstance inInstance)
[@function] AudioComponentInstanceGetComponent
|
static int |
AudioComponentInstanceNew(AudioComponent inComponent,
org.moe.natj.general.ptr.Ptr<AudioComponentInstance> outInstance)
[@function] AudioComponentInstanceNew
|
static void |
AudioComponentInstantiate(AudioComponent inComponent,
int inOptions,
AudioToolbox.Block_AudioComponentInstantiate inCompletionHandler)
[@function] AudioComponentInstantiate
|
static AudioComponent |
AudioComponentRegister(AudioComponentDescription inDesc,
CFStringRef inName,
int inVersion,
AudioToolbox.Function_AudioComponentRegister inFactory)
[@function] AudioComponentRegister
|
static int |
AudioConverterConvertBuffer(AudioConverterRef inAudioConverter,
int inInputDataSize,
org.moe.natj.general.ptr.ConstVoidPtr inInputData,
org.moe.natj.general.ptr.IntPtr ioOutputDataSize,
org.moe.natj.general.ptr.VoidPtr outOutputData)
-----------------------------------------------------------------------------
[@function] AudioConverterConvertBuffer
|
static int |
AudioConverterConvertComplexBuffer(AudioConverterRef inAudioConverter,
int inNumberPCMFrames,
AudioBufferList inInputData,
AudioBufferList outOutputData)
-----------------------------------------------------------------------------
[@function] AudioConverterConvertComplexBuffer
|
static int |
AudioConverterDispose(AudioConverterRef inAudioConverter)
-----------------------------------------------------------------------------
[@function] AudioConverterDispose
|
static int |
AudioConverterFillComplexBuffer(AudioConverterRef inAudioConverter,
AudioToolbox.Function_AudioConverterFillComplexBuffer inInputDataProc,
org.moe.natj.general.ptr.VoidPtr inInputDataProcUserData,
org.moe.natj.general.ptr.IntPtr ioOutputDataPacketSize,
AudioBufferList outOutputData,
AudioStreamPacketDescription outPacketDescription)
-----------------------------------------------------------------------------
[@function] AudioConverterFillComplexBuffer
|
static int |
AudioConverterGetProperty(AudioConverterRef inAudioConverter,
int inPropertyID,
org.moe.natj.general.ptr.IntPtr ioPropertyDataSize,
org.moe.natj.general.ptr.VoidPtr outPropertyData)
-----------------------------------------------------------------------------
[@function] AudioConverterGetProperty
|
static int |
AudioConverterGetPropertyInfo(AudioConverterRef inAudioConverter,
int inPropertyID,
org.moe.natj.general.ptr.IntPtr outSize,
org.moe.natj.general.ptr.BytePtr outWritable)
-----------------------------------------------------------------------------
[@function] AudioConverterGetPropertyInfo
|
static int |
AudioConverterNew(AudioStreamBasicDescription inSourceFormat,
AudioStreamBasicDescription inDestinationFormat,
org.moe.natj.general.ptr.Ptr<AudioConverterRef> outAudioConverter)
-----------------------------------------------------------------------------
[@function] AudioConverterNew
|
static int |
AudioConverterNewSpecific(AudioStreamBasicDescription inSourceFormat,
AudioStreamBasicDescription inDestinationFormat,
int inNumberClassDescriptions,
AudioClassDescription inClassDescriptions,
org.moe.natj.general.ptr.Ptr<AudioConverterRef> outAudioConverter)
-----------------------------------------------------------------------------
[@function] AudioConverterNewSpecific
|
static int |
AudioConverterReset(AudioConverterRef inAudioConverter)
-----------------------------------------------------------------------------
[@function] AudioConverterReset
|
static int |
AudioConverterSetProperty(AudioConverterRef inAudioConverter,
int inPropertyID,
int inPropertyDataSize,
org.moe.natj.general.ptr.ConstVoidPtr inPropertyData)
-----------------------------------------------------------------------------
[@function] AudioConverterSetProperty
|
static int |
AudioFileClose(AudioFileID inAudioFile)
[@function] AudioFileClose
|
static int |
AudioFileCountUserData(AudioFileID inAudioFile,
int inUserDataID,
org.moe.natj.general.ptr.IntPtr outNumberItems)
[@function] AudioFileCountUserData
|
static int |
AudioFileCreateWithURL(CFURLRef inFileRef,
int inFileType,
AudioStreamBasicDescription inFormat,
int inFlags,
org.moe.natj.general.ptr.Ptr<AudioFileID> outAudioFile)
[@function] AudioFileCreateWithURL
|
static int |
AudioFileGetGlobalInfo(int inPropertyID,
int inSpecifierSize,
org.moe.natj.general.ptr.VoidPtr inSpecifier,
org.moe.natj.general.ptr.IntPtr ioDataSize,
org.moe.natj.general.ptr.VoidPtr outPropertyData)
[@function] AudioFileGetGlobalInfo
|
static int |
AudioFileGetGlobalInfoSize(int inPropertyID,
int inSpecifierSize,
org.moe.natj.general.ptr.VoidPtr inSpecifier,
org.moe.natj.general.ptr.IntPtr outDataSize)
[@function] AudioFileGetGlobalInfoSize
|
static int |
AudioFileGetProperty(AudioFileID inAudioFile,
int inPropertyID,
org.moe.natj.general.ptr.IntPtr ioDataSize,
org.moe.natj.general.ptr.VoidPtr outPropertyData)
[@function] AudioFileGetProperty
|
static int |
AudioFileGetPropertyInfo(AudioFileID inAudioFile,
int inPropertyID,
org.moe.natj.general.ptr.IntPtr outDataSize,
org.moe.natj.general.ptr.IntPtr isWritable)
[@function] AudioFileGetPropertyInfo
|
static int |
AudioFileGetUserData(AudioFileID inAudioFile,
int inUserDataID,
int inIndex,
org.moe.natj.general.ptr.IntPtr ioUserDataSize,
org.moe.natj.general.ptr.VoidPtr outUserData)
[@function] AudioFileGetUserData
|
static int |
AudioFileGetUserDataSize(AudioFileID inAudioFile,
int inUserDataID,
int inIndex,
org.moe.natj.general.ptr.IntPtr outUserDataSize)
[@function] AudioFileGetUserDataSize
|
static int |
AudioFileInitializeWithCallbacks(org.moe.natj.general.ptr.VoidPtr inClientData,
AudioToolbox.Function_AudioFileInitializeWithCallbacks_1 inReadFunc,
AudioToolbox.Function_AudioFileInitializeWithCallbacks_2 inWriteFunc,
AudioToolbox.Function_AudioFileInitializeWithCallbacks_3 inGetSizeFunc,
AudioToolbox.Function_AudioFileInitializeWithCallbacks_4 inSetSizeFunc,
int inFileType,
AudioStreamBasicDescription inFormat,
int inFlags,
org.moe.natj.general.ptr.Ptr<AudioFileID> outAudioFile)
[@function] AudioFileInitializeWithCallbacks
|
static int |
AudioFileOpenURL(CFURLRef inFileRef,
byte inPermissions,
int inFileTypeHint,
org.moe.natj.general.ptr.Ptr<AudioFileID> outAudioFile)
[@function] AudioFileOpenURL
|
static int |
AudioFileOpenWithCallbacks(org.moe.natj.general.ptr.VoidPtr inClientData,
AudioToolbox.Function_AudioFileOpenWithCallbacks_1 inReadFunc,
AudioToolbox.Function_AudioFileOpenWithCallbacks_2 inWriteFunc,
AudioToolbox.Function_AudioFileOpenWithCallbacks_3 inGetSizeFunc,
AudioToolbox.Function_AudioFileOpenWithCallbacks_4 inSetSizeFunc,
int inFileTypeHint,
org.moe.natj.general.ptr.Ptr<AudioFileID> outAudioFile)
[@function] AudioFileOpenWithCallbacks
|
static int |
AudioFileOptimize(AudioFileID inAudioFile)
[@function] AudioFileOptimize
|
static int |
AudioFileReadBytes(AudioFileID inAudioFile,
byte inUseCache,
long inStartingByte,
org.moe.natj.general.ptr.IntPtr ioNumBytes,
org.moe.natj.general.ptr.VoidPtr outBuffer)
[@function] AudioFileReadBytes
|
static int |
AudioFileReadPacketData(AudioFileID inAudioFile,
byte inUseCache,
org.moe.natj.general.ptr.IntPtr ioNumBytes,
org.moe.natj.general.ptr.Ptr<AudioStreamPacketDescription> outPacketDescriptions,
long inStartingPacket,
org.moe.natj.general.ptr.IntPtr ioNumPackets,
org.moe.natj.general.ptr.VoidPtr outBuffer)
[@function] AudioFileReadPacketData
|
static int |
AudioFileReadPackets(AudioFileID inAudioFile,
byte inUseCache,
org.moe.natj.general.ptr.IntPtr outNumBytes,
org.moe.natj.general.ptr.Ptr<AudioStreamPacketDescription> outPacketDescriptions,
long inStartingPacket,
org.moe.natj.general.ptr.IntPtr ioNumPackets,
org.moe.natj.general.ptr.VoidPtr outBuffer)
Deprecated.
|
static int |
AudioFileRemoveUserData(AudioFileID inAudioFile,
int inUserDataID,
int inIndex)
[@function] AudioFileRemoveUserData
|
static int |
AudioFileSetProperty(AudioFileID inAudioFile,
int inPropertyID,
int inDataSize,
org.moe.natj.general.ptr.ConstVoidPtr inPropertyData)
[@function] AudioFileSetProperty
|
static int |
AudioFileSetUserData(AudioFileID inAudioFile,
int inUserDataID,
int inIndex,
int inUserDataSize,
org.moe.natj.general.ptr.ConstVoidPtr inUserData)
[@function] AudioFileSetUserData
|
static int |
AudioFileStreamClose(AudioFileStreamID inAudioFileStream)
[@function] AudioFileStreamClose
|
static int |
AudioFileStreamGetProperty(AudioFileStreamID inAudioFileStream,
int inPropertyID,
org.moe.natj.general.ptr.IntPtr ioPropertyDataSize,
org.moe.natj.general.ptr.VoidPtr outPropertyData)
[@function] AudioFileStreamGetProperty
|
static int |
AudioFileStreamGetPropertyInfo(AudioFileStreamID inAudioFileStream,
int inPropertyID,
org.moe.natj.general.ptr.IntPtr outPropertyDataSize,
org.moe.natj.general.ptr.BytePtr outWritable)
[@function] AudioFileStreamGetPropertyInfo
|
static int |
AudioFileStreamOpen(org.moe.natj.general.ptr.VoidPtr inClientData,
AudioToolbox.Function_AudioFileStreamOpen_1 inPropertyListenerProc,
AudioToolbox.Function_AudioFileStreamOpen_2 inPacketsProc,
int inFileTypeHint,
org.moe.natj.general.ptr.Ptr<AudioFileStreamID> outAudioFileStream)
[@function] AudioFileStreamOpen
|
static int |
AudioFileStreamParseBytes(AudioFileStreamID inAudioFileStream,
int inDataByteSize,
org.moe.natj.general.ptr.ConstVoidPtr inData,
int inFlags)
[@function] AudioFileStreamParseBytes
|
static int |
AudioFileStreamSeek(AudioFileStreamID inAudioFileStream,
long inPacketOffset,
org.moe.natj.general.ptr.LongPtr outDataByteOffset,
org.moe.natj.general.ptr.IntPtr ioFlags)
[@function] AudioFileStreamSeek
|
static int |
AudioFileStreamSetProperty(AudioFileStreamID inAudioFileStream,
int inPropertyID,
int inPropertyDataSize,
org.moe.natj.general.ptr.ConstVoidPtr inPropertyData)
[@function] AudioFileStreamSetProperty
|
static int |
AudioFileWriteBytes(AudioFileID inAudioFile,
byte inUseCache,
long inStartingByte,
org.moe.natj.general.ptr.IntPtr ioNumBytes,
org.moe.natj.general.ptr.ConstVoidPtr inBuffer)
[@function] AudioFileWriteBytes
|
static int |
AudioFileWritePackets(AudioFileID inAudioFile,
byte inUseCache,
int inNumBytes,
org.moe.natj.general.ptr.ConstPtr<AudioStreamPacketDescription> inPacketDescriptions,
long inStartingPacket,
org.moe.natj.general.ptr.IntPtr ioNumPackets,
org.moe.natj.general.ptr.ConstVoidPtr inBuffer)
[@function] AudioFileWritePackets
|
static int |
AudioFormatGetProperty(int inPropertyID,
int inSpecifierSize,
org.moe.natj.general.ptr.ConstVoidPtr inSpecifier,
org.moe.natj.general.ptr.IntPtr ioPropertyDataSize,
org.moe.natj.general.ptr.VoidPtr outPropertyData)
[@function] AudioFormatGetProperty
|
static int |
AudioFormatGetPropertyInfo(int inPropertyID,
int inSpecifierSize,
org.moe.natj.general.ptr.ConstVoidPtr inSpecifier,
org.moe.natj.general.ptr.IntPtr outPropertyDataSize)
[@function] AudioFormatGetPropertyInfo
|
static UIImage |
AudioOutputUnitGetHostIcon(AudioComponentInstance au,
float desiredPointSize) |
static int |
AudioOutputUnitPublish(AudioComponentDescription inDesc,
CFStringRef inName,
int inVersion,
AudioComponentInstance inOutputUnit)
[@function] AudioOutputUnitPublish
|
static int |
AudioOutputUnitStart(AudioComponentInstance ci)
-----------------------------------------------------------------------------
Start/stop methods for output units
-----------------------------------------------------------------------------
|
static int |
AudioOutputUnitStop(AudioComponentInstance ci) |
static int |
AudioQueueAddPropertyListener(AudioQueueRef inAQ,
int inID,
AudioToolbox.Function_AudioQueueAddPropertyListener inProc,
org.moe.natj.general.ptr.VoidPtr inUserData)
[@function] AudioQueueAddPropertyListener
|
static int |
AudioQueueAllocateBuffer(AudioQueueRef inAQ,
int inBufferByteSize,
org.moe.natj.general.ptr.Ptr<org.moe.natj.general.ptr.Ptr<AudioQueueBuffer>> outBuffer)
[@function] AudioQueueAllocateBuffer
|
static int |
AudioQueueAllocateBufferWithPacketDescriptions(AudioQueueRef inAQ,
int inBufferByteSize,
int inNumberPacketDescriptions,
org.moe.natj.general.ptr.Ptr<org.moe.natj.general.ptr.Ptr<AudioQueueBuffer>> outBuffer)
[@function] AudioQueueAllocateBufferWithPacketDescriptions
|
static int |
AudioQueueCreateTimeline(AudioQueueRef inAQ,
org.moe.natj.general.ptr.Ptr<AudioQueueTimelineRef> outTimeline)
[@function] AudioQueueCreateTimeline
|
static int |
AudioQueueDeviceGetCurrentTime(AudioQueueRef inAQ,
AudioTimeStamp outTimeStamp)
[@function] AudioQueueDeviceGetCurrentTime
|
static int |
AudioQueueDeviceGetNearestStartTime(AudioQueueRef inAQ,
AudioTimeStamp ioRequestedStartTime,
int inFlags)
[@function] AudioQueueDeviceGetNearestStartTime
|
static int |
AudioQueueDeviceTranslateTime(AudioQueueRef inAQ,
AudioTimeStamp inTime,
AudioTimeStamp outTime)
[@function] AudioQueueDeviceTranslateTime
|
static int |
AudioQueueDispose(AudioQueueRef inAQ,
byte inImmediate)
[@function] AudioQueueDispose
|
static int |
AudioQueueDisposeTimeline(AudioQueueRef inAQ,
AudioQueueTimelineRef inTimeline)
[@function] AudioQueueDisposeTimeline
|
static int |
AudioQueueEnqueueBuffer(AudioQueueRef inAQ,
AudioQueueBuffer inBuffer,
int inNumPacketDescs,
AudioStreamPacketDescription inPacketDescs)
[@function] AudioQueueEnqueueBuffer
|
static int |
AudioQueueEnqueueBufferWithParameters(AudioQueueRef inAQ,
AudioQueueBuffer inBuffer,
int inNumPacketDescs,
AudioStreamPacketDescription inPacketDescs,
int inTrimFramesAtStart,
int inTrimFramesAtEnd,
int inNumParamValues,
AudioQueueParameterEvent inParamValues,
AudioTimeStamp inStartTime,
AudioTimeStamp outActualStartTime)
[@function] AudioQueueEnqueueBufferWithParameters
|
static int |
AudioQueueFlush(AudioQueueRef inAQ)
[@function] AudioQueueFlush
|
static int |
AudioQueueFreeBuffer(AudioQueueRef inAQ,
AudioQueueBuffer inBuffer)
[@function] AudioQueueFreeBuffer
|
static int |
AudioQueueGetCurrentTime(AudioQueueRef inAQ,
AudioQueueTimelineRef inTimeline,
AudioTimeStamp outTimeStamp,
org.moe.natj.general.ptr.BytePtr outTimelineDiscontinuity)
[@function] AudioQueueGetCurrentTime
|
static int |
AudioQueueGetParameter(AudioQueueRef inAQ,
int inParamID,
org.moe.natj.general.ptr.FloatPtr outValue)
[@function] AudioQueueGetParameter
|
static int |
AudioQueueGetProperty(AudioQueueRef inAQ,
int inID,
org.moe.natj.general.ptr.VoidPtr outData,
org.moe.natj.general.ptr.IntPtr ioDataSize)
[@function] AudioQueueGetProperty
|
static int |
AudioQueueGetPropertySize(AudioQueueRef inAQ,
int inID,
org.moe.natj.general.ptr.IntPtr outDataSize)
[@function] AudioQueueGetPropertySize
|
static int |
AudioQueueNewInput(AudioStreamBasicDescription inFormat,
AudioToolbox.Function_AudioQueueNewInput inCallbackProc,
org.moe.natj.general.ptr.VoidPtr inUserData,
CFRunLoopRef inCallbackRunLoop,
CFStringRef inCallbackRunLoopMode,
int inFlags,
org.moe.natj.general.ptr.Ptr<AudioQueueRef> outAQ)
[@function] AudioQueueNewInput
|
static int |
AudioQueueNewInputWithDispatchQueue(org.moe.natj.general.ptr.Ptr<AudioQueueRef> outAQ,
AudioStreamBasicDescription inFormat,
int inFlags,
NSObject inCallbackDispatchQueue,
AudioToolbox.Block_AudioQueueNewInputWithDispatchQueue inCallbackBlock)
[@function] AudioQueueNewInputWithDispatchQueue
|
static int |
AudioQueueNewOutput(AudioStreamBasicDescription inFormat,
AudioToolbox.Function_AudioQueueNewOutput inCallbackProc,
org.moe.natj.general.ptr.VoidPtr inUserData,
CFRunLoopRef inCallbackRunLoop,
CFStringRef inCallbackRunLoopMode,
int inFlags,
org.moe.natj.general.ptr.Ptr<AudioQueueRef> outAQ)
[@function] AudioQueueNewOutput
|
static int |
AudioQueueNewOutputWithDispatchQueue(org.moe.natj.general.ptr.Ptr<AudioQueueRef> outAQ,
AudioStreamBasicDescription inFormat,
int inFlags,
NSObject inCallbackDispatchQueue,
AudioToolbox.Block_AudioQueueNewOutputWithDispatchQueue inCallbackBlock)
[@function] AudioQueueNewOutputWithDispatchQueue
|
static int |
AudioQueueOfflineRender(AudioQueueRef inAQ,
AudioTimeStamp inTimestamp,
AudioQueueBuffer ioBuffer,
int inNumberFrames)
[@function] AudioQueueOfflineRender
|
static int |
AudioQueuePause(AudioQueueRef inAQ)
[@function] AudioQueuePause
|
static int |
AudioQueuePrime(AudioQueueRef inAQ,
int inNumberOfFramesToPrepare,
org.moe.natj.general.ptr.IntPtr outNumberOfFramesPrepared)
[@function] AudioQueuePrime
|
static int |
AudioQueueProcessingTapDispose(AudioQueueProcessingTapRef inAQTap)
[@function] AudioQueueProcessingTapDispose
|
static int |
AudioQueueProcessingTapGetQueueTime(AudioQueueProcessingTapRef inAQTap,
org.moe.natj.general.ptr.DoublePtr outQueueSampleTime,
org.moe.natj.general.ptr.IntPtr outQueueFrameCount)
[@function] AudioQueueProcessingTapGetQueueTime
|
static int |
AudioQueueProcessingTapGetSourceAudio(AudioQueueProcessingTapRef inAQTap,
int inNumberFrames,
AudioTimeStamp ioTimeStamp,
org.moe.natj.general.ptr.IntPtr outFlags,
org.moe.natj.general.ptr.IntPtr outNumberFrames,
AudioBufferList ioData)
[@function] AudioQueueProcessingTapGetSourceAudio
|
static int |
AudioQueueProcessingTapNew(AudioQueueRef inAQ,
AudioToolbox.Function_AudioQueueProcessingTapNew inCallback,
org.moe.natj.general.ptr.VoidPtr inClientData,
int inFlags,
org.moe.natj.general.ptr.IntPtr outMaxFrames,
AudioStreamBasicDescription outProcessingFormat,
org.moe.natj.general.ptr.Ptr<AudioQueueProcessingTapRef> outAQTap)
[@function] AudioQueueProcessingTapNew
|
static int |
AudioQueueRemovePropertyListener(AudioQueueRef inAQ,
int inID,
AudioToolbox.Function_AudioQueueRemovePropertyListener inProc,
org.moe.natj.general.ptr.VoidPtr inUserData)
[@function] AudioQueueRemovePropertyListener
|
static int |
AudioQueueReset(AudioQueueRef inAQ)
[@function] AudioQueueReset
|
static int |
AudioQueueSetOfflineRenderFormat(AudioQueueRef inAQ,
AudioStreamBasicDescription inFormat,
AudioChannelLayout inLayout)
[@function] AudioQueueSetOfflineRenderFormat
|
static int |
AudioQueueSetParameter(AudioQueueRef inAQ,
int inParamID,
float inValue)
[@function] AudioQueueSetParameter
|
static int |
AudioQueueSetProperty(AudioQueueRef inAQ,
int inID,
org.moe.natj.general.ptr.ConstVoidPtr inData,
int inDataSize)
[@function] AudioQueueSetProperty
|
static int |
AudioQueueStart(AudioQueueRef inAQ,
AudioTimeStamp inStartTime)
[@function] AudioQueueStart
|
static int |
AudioQueueStop(AudioQueueRef inAQ,
byte inImmediate)
[@function] AudioQueueStop
|
static int |
AudioServicesAddSystemSoundCompletion(int inSystemSoundID,
CFRunLoopRef inRunLoop,
CFStringRef inRunLoopMode,
AudioToolbox.Function_AudioServicesAddSystemSoundCompletion inCompletionRoutine,
org.moe.natj.general.ptr.VoidPtr inClientData)
This function will be deprecated in a future release.
|
static int |
AudioServicesCreateSystemSoundID(CFURLRef inFileURL,
org.moe.natj.general.ptr.IntPtr outSystemSoundID)
[@function] AudioServicesCreateSystemSoundID
|
static int |
AudioServicesDisposeSystemSoundID(int inSystemSoundID)
[@function] AudioServicesDisposeSystemSoundID
|
static int |
AudioServicesGetProperty(int inPropertyID,
int inSpecifierSize,
org.moe.natj.general.ptr.ConstVoidPtr inSpecifier,
org.moe.natj.general.ptr.IntPtr ioPropertyDataSize,
org.moe.natj.general.ptr.VoidPtr outPropertyData)
[@function] AudioServicesGetProperty
|
static int |
AudioServicesGetPropertyInfo(int inPropertyID,
int inSpecifierSize,
org.moe.natj.general.ptr.ConstVoidPtr inSpecifier,
org.moe.natj.general.ptr.IntPtr outPropertyDataSize,
org.moe.natj.general.ptr.BytePtr outWritable)
[@function] AudioServicesGetPropertyInfo
|
static void |
AudioServicesPlayAlertSound(int inSystemSoundID)
This function will be deprecated in a future release.
|
static void |
AudioServicesPlayAlertSoundWithCompletion(int inSystemSoundID,
AudioToolbox.Block_AudioServicesPlayAlertSoundWithCompletion inCompletionBlock)
[@function] AudioServicesPlayAlertSoundWithCompletion
|
static void |
AudioServicesPlaySystemSound(int inSystemSoundID)
This function will be deprecated in a future release.
|
static void |
AudioServicesPlaySystemSoundWithCompletion(int inSystemSoundID,
AudioToolbox.Block_AudioServicesPlaySystemSoundWithCompletion inCompletionBlock)
[@function] AudioServicesPlaySystemSoundWithCompletion
|
static void |
AudioServicesRemoveSystemSoundCompletion(int inSystemSoundID)
This function will be deprecated in a future release.
|
static int |
AudioServicesSetProperty(int inPropertyID,
int inSpecifierSize,
org.moe.natj.general.ptr.ConstVoidPtr inSpecifier,
int inPropertyDataSize,
org.moe.natj.general.ptr.ConstVoidPtr inPropertyData)
[@function] AudioServicesSetProperty
|
static int |
AudioSessionAddPropertyListener(int inID,
AudioToolbox.Function_AudioSessionAddPropertyListener inProc,
org.moe.natj.general.ptr.VoidPtr inClientData)
Deprecated.
|
static int |
AudioSessionGetProperty(int inID,
org.moe.natj.general.ptr.IntPtr ioDataSize,
org.moe.natj.general.ptr.VoidPtr outData)
Deprecated.
|
static int |
AudioSessionGetPropertySize(int inID,
org.moe.natj.general.ptr.IntPtr outDataSize)
Deprecated.
|
static int |
AudioSessionInitialize(CFRunLoopRef inRunLoop,
CFStringRef inRunLoopMode,
AudioToolbox.Function_AudioSessionInitialize inInterruptionListener,
org.moe.natj.general.ptr.VoidPtr inClientData)
Deprecated.
|
static int |
AudioSessionRemovePropertyListener(int inID)
Deprecated.
|
static int |
AudioSessionRemovePropertyListenerWithUserData(int inID,
AudioToolbox.Function_AudioSessionRemovePropertyListenerWithUserData inProc,
org.moe.natj.general.ptr.VoidPtr inClientData)
Deprecated.
|
static int |
AudioSessionSetActive(byte active)
Deprecated.
|
static int |
AudioSessionSetActiveWithFlags(byte active,
int inFlags)
Deprecated.
|
static int |
AudioSessionSetProperty(int inID,
int inDataSize,
org.moe.natj.general.ptr.ConstVoidPtr inData)
Deprecated.
|
static int |
AudioUnitAddPropertyListener(AudioComponentInstance inUnit,
int inID,
AudioToolbox.Function_AudioUnitAddPropertyListener inProc,
org.moe.natj.general.ptr.VoidPtr inProcUserData)
[@function] AudioUnitAddPropertyListener
|
static int |
AudioUnitAddRenderNotify(AudioComponentInstance inUnit,
AudioToolbox.Function_AudioUnitAddRenderNotify inProc,
org.moe.natj.general.ptr.VoidPtr inProcUserData)
[@function] AudioUnitAddRenderNotify
|
static CFArrayRef |
AudioUnitExtensionCopyComponentList(CFStringRef extensionIdentifier)
[@function] AudioUnitExtensionCopyComponentList
|
static int |
AudioUnitExtensionSetComponentList(CFStringRef extensionIdentifier,
CFArrayRef audioComponentInfo)
[@function] AudioUnitExtensionSetComponentList
|
static int |
AudioUnitGetParameter(AudioComponentInstance inUnit,
int inID,
int inScope,
int inElement,
org.moe.natj.general.ptr.FloatPtr outValue)
[@function] AudioUnitGetParameter
|
static int |
AudioUnitGetProperty(AudioComponentInstance inUnit,
int inID,
int inScope,
int inElement,
org.moe.natj.general.ptr.VoidPtr outData,
org.moe.natj.general.ptr.IntPtr ioDataSize)
[@function] AudioUnitGetProperty
|
static int |
AudioUnitGetPropertyInfo(AudioComponentInstance inUnit,
int inID,
int inScope,
int inElement,
org.moe.natj.general.ptr.IntPtr outDataSize,
org.moe.natj.general.ptr.BytePtr outWritable)
[@function] AudioUnitGetPropertyInfo
|
static int |
AudioUnitInitialize(AudioComponentInstance inUnit)
[@function] AudioUnitInitialize
|
static int |
AudioUnitProcess(AudioComponentInstance inUnit,
org.moe.natj.general.ptr.IntPtr ioActionFlags,
AudioTimeStamp inTimeStamp,
int inNumberFrames,
AudioBufferList ioData) |
static int |
AudioUnitProcessMultiple(AudioComponentInstance inUnit,
org.moe.natj.general.ptr.IntPtr ioActionFlags,
AudioTimeStamp inTimeStamp,
int inNumberFrames,
int inNumberInputBufferLists,
org.moe.natj.general.ptr.Ptr<org.moe.natj.general.ptr.ConstPtr<AudioBufferList>> inInputBufferLists,
int inNumberOutputBufferLists,
org.moe.natj.general.ptr.Ptr<org.moe.natj.general.ptr.Ptr<AudioBufferList>> ioOutputBufferLists) |
static int |
AudioUnitRemovePropertyListenerWithUserData(AudioComponentInstance inUnit,
int inID,
AudioToolbox.Function_AudioUnitRemovePropertyListenerWithUserData inProc,
org.moe.natj.general.ptr.VoidPtr inProcUserData)
[@function] AudioUnitRemovePropertyListenerWithUserData
|
static int |
AudioUnitRemoveRenderNotify(AudioComponentInstance inUnit,
AudioToolbox.Function_AudioUnitRemoveRenderNotify inProc,
org.moe.natj.general.ptr.VoidPtr inProcUserData)
[@function] AudioUnitRemoveRenderNotify
|
static int |
AudioUnitRender(AudioComponentInstance inUnit,
org.moe.natj.general.ptr.IntPtr ioActionFlags,
AudioTimeStamp inTimeStamp,
int inOutputBusNumber,
int inNumberFrames,
AudioBufferList ioData)
[@function] AudioUnitRender
|
static int |
AudioUnitReset(AudioComponentInstance inUnit,
int inScope,
int inElement)
[@function] AudioUnitReset
|
static int |
AudioUnitScheduleParameters(AudioComponentInstance inUnit,
org.moe.natj.general.ptr.VoidPtr inParameterEvent,
int inNumParamEvents)
[@function] AudioUnitScheduleParameters
|
static int |
AudioUnitSetParameter(AudioComponentInstance inUnit,
int inID,
int inScope,
int inElement,
float inValue,
int inBufferOffsetInFrames)
[@function] AudioUnitSetParameter
|
static int |
AudioUnitSetProperty(AudioComponentInstance inUnit,
int inID,
int inScope,
int inElement,
org.moe.natj.general.ptr.ConstVoidPtr inData,
int inDataSize)
[@function] AudioUnitSetProperty
|
static int |
AudioUnitUninitialize(AudioComponentInstance inUnit)
[@function] AudioUnitUninitialize
|
static OS_os_workgroup |
AudioWorkIntervalCreate(java.lang.String name,
int clock,
os_workgroup_attr_opaque_s attr)
[@fn] AudioWorkIntervalCreate
|
static int |
AUGraphAddNode(AUGraph inGraph,
AudioComponentDescription inDescription,
org.moe.natj.general.ptr.IntPtr outNode)
[@function] AUGraphAddNode
|
static int |
AUGraphAddRenderNotify(AUGraph inGraph,
AudioToolbox.Function_AUGraphAddRenderNotify inCallback,
org.moe.natj.general.ptr.VoidPtr inRefCon)
[@function] AUGraphAddRenderNotify
|
static int |
AUGraphClearConnections(AUGraph inGraph)
[@function] AUGraphClearConnections
|
static int |
AUGraphClose(AUGraph inGraph)
[@function] AUGraphClose
|
static int |
AUGraphConnectNodeInput(AUGraph inGraph,
int inSourceNode,
int inSourceOutputNumber,
int inDestNode,
int inDestInputNumber)
[@function] AUGraphConnectNodeInput
|
static int |
AUGraphCountNodeInteractions(AUGraph inGraph,
int inNode,
org.moe.natj.general.ptr.IntPtr outNumInteractions)
[@function] AUGraphCountNodeInteractions
|
static int |
AUGraphDisconnectNodeInput(AUGraph inGraph,
int inDestNode,
int inDestInputNumber)
[@function] AUGraphDisconnectNodeInput
|
static int |
AUGraphGetCPULoad(AUGraph inGraph,
org.moe.natj.general.ptr.FloatPtr outAverageCPULoad)
[@function] AUGraphGetCPULoad
|
static int |
AUGraphGetIndNode(AUGraph inGraph,
int inIndex,
org.moe.natj.general.ptr.IntPtr outNode)
[@function] AUGraphGetIndNode
|
static int |
AUGraphGetInteractionInfo(AUGraph inGraph,
int inInteractionIndex,
org.moe.natj.general.ptr.VoidPtr outInteraction)
[@function] AUGraphGetInteractionInfo
|
static int |
AUGraphGetMaxCPULoad(AUGraph inGraph,
org.moe.natj.general.ptr.FloatPtr outMaxLoad)
[@function] AUGraphGetMaxCPULoad
|
static int |
AUGraphGetNodeCount(AUGraph inGraph,
org.moe.natj.general.ptr.IntPtr outNumberOfNodes)
[@function] AUGraphGetNodeCount
|
static int |
AUGraphGetNodeInteractions(AUGraph inGraph,
int inNode,
org.moe.natj.general.ptr.IntPtr ioNumInteractions,
org.moe.natj.general.ptr.VoidPtr outInteractions)
[@function] AUGraphGetNodeInteractions
|
static int |
AUGraphGetNumberOfInteractions(AUGraph inGraph,
org.moe.natj.general.ptr.IntPtr outNumInteractions)
[@function] AUGraphGetNumberOfInteractions
|
static int |
AUGraphInitialize(AUGraph inGraph)
[@function] AUGraphInitialize
|
static int |
AUGraphIsInitialized(AUGraph inGraph,
org.moe.natj.general.ptr.BytePtr outIsInitialized)
[@function] AUGraphIsInitialized
|
static int |
AUGraphIsOpen(AUGraph inGraph,
org.moe.natj.general.ptr.BytePtr outIsOpen)
[@function] AUGraphIsOpen
|
static int |
AUGraphIsRunning(AUGraph inGraph,
org.moe.natj.general.ptr.BytePtr outIsRunning)
[@function] AUGraphIsRunning
|
static int |
AUGraphNodeInfo(AUGraph inGraph,
int inNode,
AudioComponentDescription outDescription,
org.moe.natj.general.ptr.Ptr<AudioComponentInstance> outAudioUnit)
[@function] AUGraphNodeInfo
|
static int |
AUGraphOpen(AUGraph inGraph)
[@function] AUGraphOpen
|
static int |
AUGraphRemoveNode(AUGraph inGraph,
int inNode)
[@function] AUGraphRemoveNode
|
static int |
AUGraphRemoveRenderNotify(AUGraph inGraph,
AudioToolbox.Function_AUGraphRemoveRenderNotify inCallback,
org.moe.natj.general.ptr.VoidPtr inRefCon)
[@function] AUGraphRemoveRenderNotify
|
static int |
AUGraphSetNodeInputCallback(AUGraph inGraph,
int inDestNode,
int inDestInputNumber,
AURenderCallbackStruct inInputCallback)
[@function] AUGraphSetNodeInputCallback
|
static int |
AUGraphStart(AUGraph inGraph)
[@function] AUGraphStart
|
static int |
AUGraphStop(AUGraph inGraph)
[@function] AUGraphStop
|
static int |
AUGraphUninitialize(AUGraph inGraph)
[@function] AUGraphUninitialize
|
static int |
AUGraphUpdate(AUGraph inGraph,
org.moe.natj.general.ptr.BytePtr outIsUpdated)
[@function] AUGraphUpdate
|
static void |
CAShow(org.moe.natj.general.ptr.VoidPtr inObject)
Print the internal state of an object to os_log.
|
static void |
CAShowFile(org.moe.natj.general.ptr.VoidPtr inObject,
FILE inFile)
Print the internal state of an object to the supplied FILE*.
|
static int |
CopyInstrumentInfoFromSoundBank(CFURLRef inURL,
org.moe.natj.general.ptr.Ptr<CFArrayRef> outInstrumentInfo)
[@function] CopyInstrumentInfoFromSoundBank
|
static int |
CopyNameFromSoundBank(CFURLRef inURL,
org.moe.natj.general.ptr.Ptr<CFStringRef> outName)
[@function] CopyNameFromSoundBank
|
static int |
DisposeAUGraph(AUGraph inGraph)
[@function] DisposeAUGraph
|
static int |
DisposeMusicEventIterator(MusicEventIterator inIterator)
[@function] DisposeMusicEventIterator
|
static int |
DisposeMusicPlayer(MusicPlayer inPlayer)
[@function] DisposeMusicPlayer
|
static int |
DisposeMusicSequence(MusicSequence inSequence)
[@function] DisposeMusicSequence
|
static int |
ExtAudioFileCreateWithURL(CFURLRef inURL,
int inFileType,
AudioStreamBasicDescription inStreamDesc,
AudioChannelLayout inChannelLayout,
int inFlags,
org.moe.natj.general.ptr.Ptr<ExtAudioFileRef> outExtAudioFile)
[@function] ExtAudioFileCreateWithURL
|
static int |
ExtAudioFileDispose(ExtAudioFileRef inExtAudioFile)
[@function] ExtAudioFileDispose
|
static int |
ExtAudioFileGetProperty(ExtAudioFileRef inExtAudioFile,
int inPropertyID,
org.moe.natj.general.ptr.IntPtr ioPropertyDataSize,
org.moe.natj.general.ptr.VoidPtr outPropertyData)
[@function] ExtAudioFileGetProperty
|
static int |
ExtAudioFileGetPropertyInfo(ExtAudioFileRef inExtAudioFile,
int inPropertyID,
org.moe.natj.general.ptr.IntPtr outSize,
org.moe.natj.general.ptr.BytePtr outWritable)
[@function] ExtAudioFileGetPropertyInfo
|
static int |
ExtAudioFileOpenURL(CFURLRef inURL,
org.moe.natj.general.ptr.Ptr<ExtAudioFileRef> outExtAudioFile)
[@function] ExtAudioFileOpenURL
|
static int |
ExtAudioFileRead(ExtAudioFileRef inExtAudioFile,
org.moe.natj.general.ptr.IntPtr ioNumberFrames,
AudioBufferList ioData)
[@function] ExtAudioFileRead
|
static int |
ExtAudioFileSeek(ExtAudioFileRef inExtAudioFile,
long inFrameOffset)
[@function] ExtAudioFileSeek
|
static int |
ExtAudioFileSetProperty(ExtAudioFileRef inExtAudioFile,
int inPropertyID,
int inPropertyDataSize,
org.moe.natj.general.ptr.ConstVoidPtr inPropertyData)
[@function] ExtAudioFileSetProperty
|
static int |
ExtAudioFileTell(ExtAudioFileRef inExtAudioFile,
org.moe.natj.general.ptr.LongPtr outFrameOffset)
[@function] ExtAudioFileTell
|
static int |
ExtAudioFileWrapAudioFileID(AudioFileID inFileID,
byte inForWriting,
org.moe.natj.general.ptr.Ptr<ExtAudioFileRef> outExtAudioFile)
[@function] ExtAudioFileWrapAudioFileID
|
static int |
ExtAudioFileWrite(ExtAudioFileRef inExtAudioFile,
int inNumberFrames,
AudioBufferList ioData)
[@function] ExtAudioFileWrite
|
static int |
ExtAudioFileWriteAsync(ExtAudioFileRef inExtAudioFile,
int inNumberFrames,
AudioBufferList ioData)
[@function] ExtAudioFileWriteAsync
|
static int |
GetAudioUnitParameterDisplayType(int flags) |
static CFStringRef |
kAudioComponentInstanceInvalidationNotification()
[@constant] kAudioComponentInstanceInvalidationNotification
|
static CFStringRef |
kAudioComponentRegistrationsChangedNotification()
[@constant] kAudioComponentRegistrationsChangedNotification
|
static CFStringRef |
kAudioSession_AudioRouteChangeKey_CurrentRouteDescription()
Deprecated.
|
static CFStringRef |
kAudioSession_AudioRouteChangeKey_PreviousRouteDescription()
Deprecated.
|
static CFStringRef |
kAudioSession_AudioRouteKey_Inputs()
Deprecated.
|
static CFStringRef |
kAudioSession_AudioRouteKey_Outputs()
Deprecated.
|
static CFStringRef |
kAudioSession_AudioRouteKey_Type()
Deprecated.
|
static CFStringRef |
kAudioSession_InputSourceKey_Description()
Deprecated.
|
static CFStringRef |
kAudioSession_InputSourceKey_ID()
Deprecated.
|
static CFStringRef |
kAudioSession_OutputDestinationKey_Description()
Deprecated.
|
static CFStringRef |
kAudioSession_OutputDestinationKey_ID()
Deprecated.
|
static CFStringRef |
kAudioSession_RouteChangeKey_Reason()
Deprecated.
|
static CFStringRef |
kAudioSessionInputRoute_BluetoothHFP()
Deprecated.
|
static CFStringRef |
kAudioSessionInputRoute_BuiltInMic()
Deprecated.
|
static CFStringRef |
kAudioSessionInputRoute_HeadsetMic()
Deprecated.
|
static CFStringRef |
kAudioSessionInputRoute_LineIn()
Deprecated.
|
static CFStringRef |
kAudioSessionInputRoute_USBAudio()
Deprecated.
|
static CFStringRef |
kAudioSessionOutputRoute_AirPlay()
Deprecated.
|
static CFStringRef |
kAudioSessionOutputRoute_BluetoothA2DP()
Deprecated.
|
static CFStringRef |
kAudioSessionOutputRoute_BluetoothHFP()
Deprecated.
|
static CFStringRef |
kAudioSessionOutputRoute_BuiltInReceiver()
Deprecated.
|
static CFStringRef |
kAudioSessionOutputRoute_BuiltInSpeaker()
Deprecated.
|
static CFStringRef |
kAudioSessionOutputRoute_HDMI()
Deprecated.
|
static CFStringRef |
kAudioSessionOutputRoute_Headphones()
Deprecated.
|
static CFStringRef |
kAudioSessionOutputRoute_LineOut()
Deprecated.
|
static CFStringRef |
kAudioSessionOutputRoute_USBAudio()
Deprecated.
|
static int |
MusicDeviceMIDIEvent(AudioComponentInstance inUnit,
int inStatus,
int inData1,
int inData2,
int inOffsetSampleFrame)
[@function] MusicDeviceMIDIEvent
|
static int |
MusicDeviceMIDIEventList(AudioComponentInstance inUnit,
int inOffsetSampleFrame,
MIDIEventList evtList)
[@function] MusicDeviceMIDIEventList
|
static int |
MusicDeviceStartNote(AudioComponentInstance inUnit,
int inInstrument,
int inGroupID,
org.moe.natj.general.ptr.IntPtr outNoteInstanceID,
int inOffsetSampleFrame,
MusicDeviceNoteParams inParams)
[@function] MusicDeviceStartNote
|
static int |
MusicDeviceStopNote(AudioComponentInstance inUnit,
int inGroupID,
int inNoteInstanceID,
int inOffsetSampleFrame)
[@function] MusicDeviceStopNote
|
static int |
MusicDeviceSysEx(AudioComponentInstance inUnit,
java.lang.String inData,
int inLength)
[@function] MusicDeviceSysEx
|
static int |
MusicEventIteratorDeleteEvent(MusicEventIterator inIterator)
[@function] MusicEventIteratorDeleteEvent
|
static int |
MusicEventIteratorGetEventInfo(MusicEventIterator inIterator,
org.moe.natj.general.ptr.DoublePtr outTimeStamp,
org.moe.natj.general.ptr.IntPtr outEventType,
org.moe.natj.general.ptr.Ptr<org.moe.natj.general.ptr.ConstVoidPtr> outEventData,
org.moe.natj.general.ptr.IntPtr outEventDataSize)
[@function] MusicEventIteratorGetEventInfo
|
static int |
MusicEventIteratorHasCurrentEvent(MusicEventIterator inIterator,
org.moe.natj.general.ptr.BytePtr outHasCurEvent)
[@function] MusicEventIteratorHasCurrentEvent
|
static int |
MusicEventIteratorHasNextEvent(MusicEventIterator inIterator,
org.moe.natj.general.ptr.BytePtr outHasNextEvent)
[@function] MusicEventIteratorHasNextEvent
|
static int |
MusicEventIteratorHasPreviousEvent(MusicEventIterator inIterator,
org.moe.natj.general.ptr.BytePtr outHasPrevEvent)
[@function] MusicEventIteratorHasPreviousEvent
|
static int |
MusicEventIteratorNextEvent(MusicEventIterator inIterator)
[@function] MusicEventIteratorNextEvent
|
static int |
MusicEventIteratorPreviousEvent(MusicEventIterator inIterator)
[@function] MusicEventIteratorPreviousEvent
|
static int |
MusicEventIteratorSeek(MusicEventIterator inIterator,
double inTimeStamp)
[@function] MusicEventIteratorSeek
|
static int |
MusicEventIteratorSetEventInfo(MusicEventIterator inIterator,
int inEventType,
org.moe.natj.general.ptr.ConstVoidPtr inEventData)
[@function] MusicEventIteratorSetEventInfo
|
static int |
MusicEventIteratorSetEventTime(MusicEventIterator inIterator,
double inTimeStamp)
[@function] MusicEventIteratorSetEventTime
|
static int |
MusicPlayerGetBeatsForHostTime(MusicPlayer inPlayer,
long inHostTime,
org.moe.natj.general.ptr.DoublePtr outBeats)
[@function] MusicPlayerGetBeatsForHostTime
|
static int |
MusicPlayerGetHostTimeForBeats(MusicPlayer inPlayer,
double inBeats,
org.moe.natj.general.ptr.LongPtr outHostTime)
[@function] MusicPlayerGetHostTimeForBeats
|
static int |
MusicPlayerGetPlayRateScalar(MusicPlayer inPlayer,
org.moe.natj.general.ptr.DoublePtr outScaleRate)
[@function] MusicPlayerGetPlayRateScalar
|
static int |
MusicPlayerGetSequence(MusicPlayer inPlayer,
org.moe.natj.general.ptr.Ptr<MusicSequence> outSequence)
[@function] MusicPlayerGetSequence
|
static int |
MusicPlayerGetTime(MusicPlayer inPlayer,
org.moe.natj.general.ptr.DoublePtr outTime)
[@function] MusicPlayerGetTime
|
static int |
MusicPlayerIsPlaying(MusicPlayer inPlayer,
org.moe.natj.general.ptr.BytePtr outIsPlaying)
[@function] MusicPlayerIsPlaying
|
static int |
MusicPlayerPreroll(MusicPlayer inPlayer)
[@function] MusicPlayerPreroll
|
static int |
MusicPlayerSetPlayRateScalar(MusicPlayer inPlayer,
double inScaleRate)
[@function] MusicPlayerSetPlayRateScalar
|
static int |
MusicPlayerSetSequence(MusicPlayer inPlayer,
MusicSequence inSequence)
[@function] MusicPlayerSetSequence
|
static int |
MusicPlayerSetTime(MusicPlayer inPlayer,
double inTime)
[@function] MusicPlayerSetTime
|
static int |
MusicPlayerStart(MusicPlayer inPlayer)
[@function] MusicPlayerStart
|
static int |
MusicPlayerStop(MusicPlayer inPlayer)
[@function] MusicPlayerStop
|
static int |
MusicSequenceBarBeatTimeToBeats(MusicSequence inSequence,
CABarBeatTime inBarBeatTime,
org.moe.natj.general.ptr.DoublePtr outBeats)
[@function] MusicSequenceBarBeatTimeToBeats
|
static int |
MusicSequenceBeatsToBarBeatTime(MusicSequence inSequence,
double inBeats,
int inSubbeatDivisor,
CABarBeatTime outBarBeatTime)
[@function] MusicSequenceBeatsToBarBeatTime
|
static int |
MusicSequenceDisposeTrack(MusicSequence inSequence,
MusicTrack inTrack)
[@function] MusicSequenceDisposeTrack
|
static int |
MusicSequenceFileCreate(MusicSequence inSequence,
CFURLRef inFileRef,
int inFileType,
int inFlags,
short inResolution)
[@function] MusicSequenceFileCreate
|
static int |
MusicSequenceFileCreateData(MusicSequence inSequence,
int inFileType,
int inFlags,
short inResolution,
org.moe.natj.general.ptr.Ptr<CFDataRef> outData)
[@function] MusicSequenceFileCreateData
|
static int |
MusicSequenceFileLoad(MusicSequence inSequence,
CFURLRef inFileRef,
int inFileTypeHint,
int inFlags)
[@function] MusicSequenceFileLoad
|
static int |
MusicSequenceFileLoadData(MusicSequence inSequence,
CFDataRef inData,
int inFileTypeHint,
int inFlags)
[@function] MusicSequenceFileLoadData
|
static int |
MusicSequenceGetAUGraph(MusicSequence inSequence,
org.moe.natj.general.ptr.Ptr<AUGraph> outGraph)
[@function] MusicSequenceGetAUGraph
|
static int |
MusicSequenceGetBeatsForSeconds(MusicSequence inSequence,
double inSeconds,
org.moe.natj.general.ptr.DoublePtr outBeats)
[@function] MusicSequenceGetBeatsForSeconds
|
static int |
MusicSequenceGetIndTrack(MusicSequence inSequence,
int inTrackIndex,
org.moe.natj.general.ptr.Ptr<MusicTrack> outTrack)
[@function] MusicSequenceGetIndTrack
|
static CFDictionaryRef |
MusicSequenceGetInfoDictionary(MusicSequence inSequence)
[@function] MusicSequenceGetInfoDictionary
|
static int |
MusicSequenceGetSecondsForBeats(MusicSequence inSequence,
double inBeats,
org.moe.natj.general.ptr.DoublePtr outSeconds)
[@function] MusicSequenceGetSecondsForBeats
|
static int |
MusicSequenceGetSequenceType(MusicSequence inSequence,
org.moe.natj.general.ptr.IntPtr outType)
[@function] MusicSequenceGetSequenceType
|
static void |
MusicSequenceGetSMPTEResolution(short inRes,
org.moe.natj.general.ptr.BytePtr fps,
org.moe.natj.general.ptr.BytePtr ticks)
[@function] MusicSequenceGetSMPTEResolution
|
static int |
MusicSequenceGetTempoTrack(MusicSequence inSequence,
org.moe.natj.general.ptr.Ptr<MusicTrack> outTrack)
[@function] MusicSequenceGetTempoTrack
|
static int |
MusicSequenceGetTrackCount(MusicSequence inSequence,
org.moe.natj.general.ptr.IntPtr outNumberOfTracks)
[@function] MusicSequenceGetTrackCount
|
static int |
MusicSequenceGetTrackIndex(MusicSequence inSequence,
MusicTrack inTrack,
org.moe.natj.general.ptr.IntPtr outTrackIndex)
[@function] MusicSequenceGetTrackIndex
|
static int |
MusicSequenceNewTrack(MusicSequence inSequence,
org.moe.natj.general.ptr.Ptr<MusicTrack> outTrack)
[@function] MusicSequenceNewTrack
|
static int |
MusicSequenceReverse(MusicSequence inSequence)
[@function] MusicSequenceReverse
|
static int |
MusicSequenceSetAUGraph(MusicSequence inSequence,
AUGraph inGraph)
[@function] MusicSequenceSetAUGraph
|
static int |
MusicSequenceSetMIDIEndpoint(MusicSequence inSequence,
int inEndpoint)
[@function] MusicSequenceSetMIDIEndpoint
|
static int |
MusicSequenceSetSequenceType(MusicSequence inSequence,
int inType)
[@function] MusicSequenceSetSequenceType
|
static short |
MusicSequenceSetSMPTEResolution(byte fps,
byte ticks)
[@function] MusicSequenceSetSMPTEResolution
|
static int |
MusicSequenceSetUserCallback(MusicSequence inSequence,
AudioToolbox.Function_MusicSequenceSetUserCallback inCallback,
org.moe.natj.general.ptr.VoidPtr inClientData)
[@function] MusicSequenceSetUserCallback
|
static int |
MusicTrackClear(MusicTrack inTrack,
double inStartTime,
double inEndTime)
[@function] MusicTrackClear
|
static int |
MusicTrackCopyInsert(MusicTrack inSourceTrack,
double inSourceStartTime,
double inSourceEndTime,
MusicTrack inDestTrack,
double inDestInsertTime)
[@function] MusicTrackCopyInsert
|
static int |
MusicTrackCut(MusicTrack inTrack,
double inStartTime,
double inEndTime)
[@function] MusicTrackCut
|
static int |
MusicTrackGetDestMIDIEndpoint(MusicTrack inTrack,
org.moe.natj.general.ptr.IntPtr outEndpoint)
[@function] MusicTrackGetDestMIDIEndpoint
|
static int |
MusicTrackGetDestNode(MusicTrack inTrack,
org.moe.natj.general.ptr.IntPtr outNode)
[@function] MusicTrackGetDestNode
|
static int |
MusicTrackGetProperty(MusicTrack inTrack,
int inPropertyID,
org.moe.natj.general.ptr.VoidPtr outData,
org.moe.natj.general.ptr.IntPtr ioLength)
[@function] MusicTrackGetProperty
|
static int |
MusicTrackGetSequence(MusicTrack inTrack,
org.moe.natj.general.ptr.Ptr<MusicSequence> outSequence)
[@function] MusicTrackGetSequence
|
static int |
MusicTrackMerge(MusicTrack inSourceTrack,
double inSourceStartTime,
double inSourceEndTime,
MusicTrack inDestTrack,
double inDestInsertTime)
[@function] MusicTrackMerge
|
static int |
MusicTrackMoveEvents(MusicTrack inTrack,
double inStartTime,
double inEndTime,
double inMoveTime)
[@function] MusicTrackMoveEvents
|
static int |
MusicTrackNewAUPresetEvent(MusicTrack inTrack,
double inTimeStamp,
AUPresetEvent inPresetEvent)
[@function] MusicTrackNewAUPresetEvent
|
static int |
MusicTrackNewExtendedNoteEvent(MusicTrack inTrack,
double inTimeStamp,
ExtendedNoteOnEvent inInfo)
[@function] MusicTrackNewExtendedNoteEvent
|
static int |
MusicTrackNewExtendedTempoEvent(MusicTrack inTrack,
double inTimeStamp,
double inBPM)
[@function] MusicTrackNewExtendedTempoEvent
|
static int |
MusicTrackNewMetaEvent(MusicTrack inTrack,
double inTimeStamp,
MIDIMetaEvent inMetaEvent)
[@function] MusicTrackNewMetaEvent
|
static int |
MusicTrackNewMIDIChannelEvent(MusicTrack inTrack,
double inTimeStamp,
MIDIChannelMessage inMessage)
[@function] MusicTrackNewMIDIChannelEvent
|
static int |
MusicTrackNewMIDINoteEvent(MusicTrack inTrack,
double inTimeStamp,
MIDINoteMessage inMessage)
[@function] MusicTrackNewMIDINoteEvent
|
static int |
MusicTrackNewMIDIRawDataEvent(MusicTrack inTrack,
double inTimeStamp,
MIDIRawData inRawData)
[@function] MusicTrackNewMIDIRawDataEvent
|
static int |
MusicTrackNewParameterEvent(MusicTrack inTrack,
double inTimeStamp,
ParameterEvent inInfo)
[@function] MusicTrackNewParameterEvent
|
static int |
MusicTrackNewUserEvent(MusicTrack inTrack,
double inTimeStamp,
MusicEventUserData inUserData)
[@function] MusicEventUserData
|
static int |
MusicTrackSetDestMIDIEndpoint(MusicTrack inTrack,
int inEndpoint)
[@function] MusicTrackSetDestMIDIEndpoint
|
static int |
MusicTrackSetDestNode(MusicTrack inTrack,
int inNode)
[@function] MusicTrackSetDestNode
|
static int |
MusicTrackSetProperty(MusicTrack inTrack,
int inPropertyID,
org.moe.natj.general.ptr.VoidPtr inData,
int inLength)
[@function] MusicTrackSetProperty
|
static int |
NewAUGraph(org.moe.natj.general.ptr.Ptr<AUGraph> outGraph)
[@function] NewAUGraph
|
static int |
NewMusicEventIterator(MusicTrack inTrack,
org.moe.natj.general.ptr.Ptr<MusicEventIterator> outIterator)
[@function] NewMusicEventIterator
|
static int |
NewMusicPlayer(org.moe.natj.general.ptr.Ptr<MusicPlayer> outPlayer)
[@function] NewMusicPlayer
|
static int |
NewMusicSequence(org.moe.natj.general.ptr.Ptr<MusicSequence> outSequence)
[@functiongroup] Music Sequence
[@function] NewMusicSequence
|
static AudioFileRegion |
NextAudioFileRegion(AudioFileRegion inAFRegionPtr) |
static long |
NumAudioFileMarkersToNumBytes(long inNumMarkers) |
static long |
NumBytesToNumAudioFileMarkers(long inNumBytes) |
static int |
SetAudioUnitParameterDisplayType(int flags,
int displayType) |
public static AudioComponent AudioComponentFindNext(AudioComponent inComponent, AudioComponentDescription inDesc)
Finds an audio component.
This function is used to find an audio component that is the closest match to the provided values. Note that the list of available components may change dynamically in situations involving inter-app audio on iOS, or version 3 audio unit extensions. See kAudioComponentRegistrationsChangedNotification.
inComponent - If NULL, then the search starts from the beginning until an audio
component is found that matches the description provided by inDesc.
If non-NULL, then the search starts (continues) from the previously
found audio component specified by inComponent, and will return the next
found audio component.inDesc - The type, subtype and manufacturer fields are used to specify the audio
component to search for. A value of 0 (zero) for any of these fields is
a wildcard, so the first match found is returned.public static int AudioComponentCount(AudioComponentDescription inDesc)
Counts audio components.
Returns the number of AudioComponents that match the specified AudioComponentDescription.
inDesc - The type, subtype and manufacturer fields are used to specify the audio
components to count A value of 0 (zero) for any of these fields is a
wildcard, so will match any value for this fieldpublic static int AudioComponentCopyName(AudioComponent inComponent, org.moe.natj.general.ptr.Ptr<CFStringRef> outName)
Retrieves the name of an audio component.
the name of an audio component
inComponent - the audio component (must not be NULL)outName - a CFString that is the name of the audio component. This string should
be released by the caller.public static int AudioComponentGetDescription(AudioComponent inComponent, AudioComponentDescription outDesc)
Retrieve an audio component's description.
This will return the fully specified audio component description for the provided audio component.
inComponent - the audio component (must not be NULL)outDesc - the audio component description for the specified audio componentpublic static int AudioComponentGetVersion(AudioComponent inComponent, org.moe.natj.general.ptr.IntPtr outVersion)
Retrieve an audio component's version.
inComponent - the audio component (must not be NULL)outVersion - the audio component's version in the form of 0xMMMMmmDD (Major, Minor, Dot)public static int AudioComponentInstanceNew(AudioComponent inComponent, org.moe.natj.general.ptr.Ptr<AudioComponentInstance> outInstance)
Creates an audio component instance.
This function creates an instance of a given audio component. The audio component instance is the object that does all of the work, whereas the audio component is the way an application finds and then creates this object to do this work. For example, an audio unit is a type of audio component instance, so to use an audio unit, one finds its audio component, and then creates a new instance of that component. This instance is then used to perform the audio tasks for which it was designed (process, mix, synthesise, etc.).
inComponent - the audio component (must not be NULL)outInstance - the audio component instancepublic static void AudioComponentInstantiate(AudioComponent inComponent, int inOptions, AudioToolbox.Block_AudioComponentInstantiate inCompletionHandler)
Creates an audio component instance, asynchronously.
This is an asynchronous version of AudioComponentInstanceNew(). It must be used to instantiate any component with kAudioComponentFlag_RequiresAsyncInstantiation set in its component flags. It may be used for other components as well.
Note: Do not block the main thread while waiting for the completion handler to be called; this can deadlock.
inComponent - the audio componentinOptions - see AudioComponentInstantiationOptionsinCompletionHandler - called in an arbitrary thread context when instantiation is complete.public static int AudioComponentInstanceDispose(AudioComponentInstance inInstance)
Disposes of an audio component instance.
This function will dispose the audio component instance that was created with the New call. It will deallocate any resources that the instance was using.
inInstance - the audio component instance to dispose (must not be NULL)public static AudioComponent AudioComponentInstanceGetComponent(AudioComponentInstance inInstance)
Retrieve the audio component from its instance
Allows the application at any time to retrieve the audio component that is the factory object of a given instance (i.e., the audio component that was used to create the instance in the first place). This allows the application to retrieve general information about a particular audio component (its name, version, etc) when one just has an audio component instance to work with
inInstance - the audio component instance (must not be NULL, and instance must be valid - that is, not disposed)public static byte AudioComponentInstanceCanDo(AudioComponentInstance inInstance, short inSelectorID)
Determines if an audio component instance implements a particular component API call as signified by the specified selector identifier token.
inInstance - the audio component instanceinSelectorID - a number to signify the audio component API (component selector) as appropriate for the instance's component type.public static AudioComponent AudioComponentRegister(AudioComponentDescription inDesc, CFStringRef inName, int inVersion, AudioToolbox.Function_AudioComponentRegister inFactory)
Dynamically registers an AudioComponent within the current process
AudioComponents are registered either when found in appropriate bundles in the filesystem, or via this call. AudioComponents registered via this call are available only within the current process.
inDesc - The AudioComponentDescription that describes the AudioComponent. Note that
the registrar needs to be sure to set the flag kAudioComponentFlag_SandboxSafe
in the componentFlags field of the AudioComponentDescription to indicate that
the AudioComponent can be loaded directly into a sandboxed process.inName - the AudioComponent's nameinVersion - the AudioComponent's versioninFactory - an AudioComponentFactoryFunction which will create instances of your
AudioComponentpublic static int AudioUnitInitialize(AudioComponentInstance inUnit)
initialize an audio unit
Upon success, the audio unit has been successfully initialized. This means that the formats for input and output are valid and can be supported and it has based its allocations on the max number of frames that it is able to render at any given time. Once initialized, it is in a state where it can be asked to render.
In common practice, major state of an audio unit (such as its I/O formats, memory allocations) cannot be changed while an audio unit is initialized.
inUnit - The audio unit to initializepublic static int AudioUnitUninitialize(AudioComponentInstance inUnit)
uninitialize an audio unit
Once an audio unit has been initialized, to change its state in response to some kind of environmental change, the audio unit should be uninitialized. This will have the effect of the audio unit de-allocating its resources. The caller can then reconfigure the audio unit to match the new environment (for instance, the sample rate to process audio is different than it was) and then re-initialize the audio unit when those changes have been applied.
inUnit - The audio unit to uninitializepublic static int AudioUnitGetPropertyInfo(AudioComponentInstance inUnit, int inID, int inScope, int inElement, org.moe.natj.general.ptr.IntPtr outDataSize, org.moe.natj.general.ptr.BytePtr outWritable)
retrieves information about a specified property
The API can be used to retrieve both the size of the property, and whether it is writable or not. In order to get a general answer on the capability of an audio unit, this function should be called before the audio unit is initialized (as some properties are writable when the audio unit is initialized, and others not)
inUnit - the audio unitinID - the property identifierinScope - the scope of the propertyinElement - the element of the scopeoutDataSize - if not null, then will retrieve the maximum size for the property. if null,
then it is ignoredoutWritable - if not null, then will retrieve whether the property can be written or not.
if null, then it is ignoredpublic static int AudioUnitGetProperty(AudioComponentInstance inUnit, int inID, int inScope, int inElement, org.moe.natj.general.ptr.VoidPtr outData, org.moe.natj.general.ptr.IntPtr ioDataSize)
retrieves the value of a specified property
The API can is used to retrieve the value of the property. Property values for audio units are always passed by reference
inUnit - the audio unitinID - the property identifierinScope - the scope of the propertyinElement - the element of the scopeoutData - used to retrieve the value of the property. It should point to memory at least
as large as the value described by ioDataSizeioDataSize - on input contains the size of the data pointed to by outData, on output, the
size of the data that was returned.public static int AudioUnitSetProperty(AudioComponentInstance inUnit, int inID, int inScope, int inElement, org.moe.natj.general.ptr.ConstVoidPtr inData, int inDataSize)
sets the value of a specified property
The API can is used to set the value of the property. Property values for audio units are always passed by reference
inUnit - the audio unitinID - the property identifierinScope - the scope of the propertyinElement - the element of the scopeinData - if not null, then is the new value for the property that will be set. If null,
then inDataSize should be zero, and the call is then used to remove a
previously set value for a property. This removal is only valid for
some properties, as most properties will always have a default value if not
set.inDataSize - the size of the data being provided in inDatapublic static int AudioUnitAddPropertyListener(AudioComponentInstance inUnit, int inID, AudioToolbox.Function_AudioUnitAddPropertyListener inProc, org.moe.natj.general.ptr.VoidPtr inProcUserData)
registration call to receive notifications for when a property changes
When an audio unit property value changes, a notification callback can be called by the audio unit to inform interested parties that this event has occurred. The notification is defined by the tuple of inProc and inProcUserData as paired to the specified property ID, so the previously defined AudioUnitRemovePropertyListener is deprecated because it didn't allow for the provision of the inProcUserData to remove a given listener (so, you should use AudioUnitRemovePropertyListenerWithUserData).
inUnit - the audio unitinID - the property identifierinProc - the procedure to call when the property changes (on any scope or element)inProcUserData - the user data to provide with the callbackpublic static int AudioUnitRemovePropertyListenerWithUserData(AudioComponentInstance inUnit, int inID, AudioToolbox.Function_AudioUnitRemovePropertyListenerWithUserData inProc, org.moe.natj.general.ptr.VoidPtr inProcUserData)
remove a previously registered property listener
Removes a previously registered property listener as specified by the inProc and inProcUser data as paired to the property identifier
inUnit - the audio unitinID - the property identifierinProc - the procedure previously registeredinProcUserData - the user data paired with the provided inProcpublic static int AudioUnitAddRenderNotify(AudioComponentInstance inUnit, AudioToolbox.Function_AudioUnitAddRenderNotify inProc, org.moe.natj.general.ptr.VoidPtr inProcUserData)
a notification callback to call when an audio unit is asked to render
allows an application to register a callback with an audio unit for whenever the audio unit is asked to render. The callback is called both before the audio unit performs its render operations (the render flag's pre-render bit is set) and after the audio unit has completed its render operations (the render flag's post-render bit is set). On post-render, the audio buffer list (ioData) will contain valid audio data that was rendered by the audio unit.
The inProc and inProcUserData are treated as a tuple entity, so when wanting to remove one, both the inProc and its inProcUserData must be specified
inUnit - the audio unitinProc - an AURenderCallback procinProcUserData - the user data that will be provided with the proc when it is calledpublic static int AudioUnitRemoveRenderNotify(AudioComponentInstance inUnit, AudioToolbox.Function_AudioUnitRemoveRenderNotify inProc, org.moe.natj.general.ptr.VoidPtr inProcUserData)
remove a previously registered render notification proc
inUnit - the audio unitinProc - an AURenderCallback procinProcUserData - the user data that was provided with the proc when it was previously
registeredpublic static int AudioUnitGetParameter(AudioComponentInstance inUnit, int inID, int inScope, int inElement, org.moe.natj.general.ptr.FloatPtr outValue)
Get the value of a parameter
Get the value of a parameter as specified by its ID, scope and element.
inUnit - the audio unitinID - the parameter IDinScope - the scope for the parameterinElement - the element on the scope for the parameteroutValue - Must be non-null, and upon success will contain the current value for the
specified parameterpublic static int AudioUnitSetParameter(AudioComponentInstance inUnit, int inID, int inScope, int inElement, float inValue, int inBufferOffsetInFrames)
Set the value of a parameter
Set the value of a parameter as specified by its ID, scope and element. Parameter IDs are consistent across all of the elements in a scope - so for a mixer, the "input volume" parameter can be applied on any input, and the particular input is specified by the elementID.
inUnit - the audio unitinID - the parameter IDinScope - the scope for the parameterinElement - the element on the scope for the parameterinValue - the new value for the parameter.inBufferOffsetInFrames - generally should be set to zero - see AudioUnitScheduleParameterspublic static int AudioUnitScheduleParameters(AudioComponentInstance inUnit, org.moe.natj.general.ptr.VoidPtr inParameterEvent, int inNumParamEvents)
Schedule changes to the value of a parameter
This API is used to schedule intra-buffer changes to the value of a parameter (immediate) or to ramp a parameter from a start value to an end value for a specified number of samples (ramp)
The API allows for the scheduling of multiple parameter events with the one call. All of the parameter events must apply to the current (and only apply to the current) audio unit render call, so the events are scheduled as a part of the pre-render notification callback.
When scheduling an immediate parameter event, the new value at the specified sample buffer offset is provided
When scheduling a ramped parameter, the ramp is scheduled each audio unit render for the duration of the ramp. Each schedule of the the new audio unit render specifies the progress of the ramp.
Parameters that can have events scheduled to them will indicate this through their parameter info struct
inUnit - the audio unitinParameterEvent - a pointer to an array of parameter event structsinNumParamEvents - the number of parameter event structs pointed to by inParameterEventpublic static int AudioUnitRender(AudioComponentInstance inUnit, org.moe.natj.general.ptr.IntPtr ioActionFlags, AudioTimeStamp inTimeStamp, int inOutputBusNumber, int inNumberFrames, AudioBufferList ioData)
the render operation where ioData will contain the results of the audio unit's render operations
an audio unit will render the amount of audio data described by inNumberOfFrames and the results of that render will be contained within ioData. The caller should provide audio time stamps where at least the sample time is valid and it is incrementing sequentially from its previous call (so, the next time stamp will be the current time stamp + inNumberFrames) If the sample time is not incrementing sequentially, the audio unit will infer that there is some discontinuity with the timeline it is rendering for
The caller must provide a valid ioData AudioBufferList that matches the expected topology for the current audio format for the given bus. The buffer list can be of two variants: (1) If the mData pointers are non-null then the audio unit will render its output into those buffers. These buffers should be aligned to 16 byte boundaries (which is normally what malloc will return). (2) If the mData pointers are null, then the audio unit can provide pointers to its own buffers. In this case the audio unit is required to keep those buffers valid for the duration of the calling thread's I/O cycle
inUnit - the audio unitioActionFlags - any appropriate action flags for the render operationinTimeStamp - the time stamp that applies to this particular render operation. when
rendering for multiple output buses the time stamp will generally be the same
for each output bus, so the audio unit is able to determine without doubt that
this the same render operationinOutputBusNumber - the output bus to render forinNumberFrames - the number of sample frames to renderioData - the audio buffer list that the audio unit is to render into.public static int AudioUnitProcess(AudioComponentInstance inUnit, org.moe.natj.general.ptr.IntPtr ioActionFlags, AudioTimeStamp inTimeStamp, int inNumberFrames, AudioBufferList ioData)
public static int AudioUnitProcessMultiple(AudioComponentInstance inUnit, org.moe.natj.general.ptr.IntPtr ioActionFlags, AudioTimeStamp inTimeStamp, int inNumberFrames, int inNumberInputBufferLists, org.moe.natj.general.ptr.Ptr<org.moe.natj.general.ptr.ConstPtr<AudioBufferList>> inInputBufferLists, int inNumberOutputBufferLists, org.moe.natj.general.ptr.Ptr<org.moe.natj.general.ptr.Ptr<AudioBufferList>> ioOutputBufferLists)
public static int AudioUnitReset(AudioComponentInstance inUnit, int inScope, int inElement)
reset an audio unit's render state
This call will clear any render state of an audio unit. For instance, with a delay or reverb type of audio unit reset will clear any of the delay lines maintained within the audio unit. Typically, this call is made when an audio unit was previously rendering, and was taken out of the render chain (say, the track it is in was muted) and is being added back in (unmuted). The host should reset the audio unit before adding it back so that it doesn't produce audio from its delay lines that is no longer valid.
The call should only clear memory, it should NOT allocate or free memory resources (this is done in the Initialize calls).
inUnit - the audio unitinScope - the scope - typically this is set to GlobalScopeinElement - the element - typically this is set to 0public static int AudioOutputUnitPublish(AudioComponentDescription inDesc, CFStringRef inName, int inVersion, AudioComponentInstance inOutputUnit)
Register an audio output unit as available to be used as an audio unit by other applications.
This allows a publishing application to register its audio (input/)output unit as being able to be redirected and repurposed as an audio unit effect, generator, music device or music effect by another host application.
inOutputUnit - The audio output unit to be published.inDesc - The AudioComponentDescription under which to register the application.inName - The application or component name.public static UIImage AudioOutputUnitGetHostIcon(AudioComponentInstance au, float desiredPointSize)
public static UIImage AudioComponentGetIcon(AudioComponent comp, float desiredPointSize)
public static double AudioComponentGetLastActiveTime(AudioComponent comp)
Fetches the time at which the application publishing the component was last active.
Inter-app audio hosts can use this to sort the list of available nodes by how recently the user interacted with them.
comp - The AudioComponent being queried.public static int AudioOutputUnitStart(AudioComponentInstance ci)
public static int AudioOutputUnitStop(AudioComponentInstance ci)
public static int GetAudioUnitParameterDisplayType(int flags)
public static int SetAudioUnitParameterDisplayType(int flags,
int displayType)
public static int MusicDeviceMIDIEvent(AudioComponentInstance inUnit, int inStatus, int inData1, int inData2, int inOffsetSampleFrame)
Used to sent MIDI channel messages to an audio unit
This is the API used to send MIDI channel messages to an audio unit. The status and data parameters are used exactly as described by the MIDI specification, including the combination of channel and command in the status byte. All events sent via MusicDeviceMIDIEventList will be delivered to the audio unit in the MIDI protocol returned by kAudioUnitProperty_AudioUnitMIDIProtocol.
inUnit - The audio unitinStatus - The MIDI status byteinData1 - The first MIDI data byte (value is in the range 0 < 128)inData2 - The second MIDI data byte (value is in the range 0 < 128). If the MIDI status byte only has one
data byte, this should be set to zero.inOffsetSampleFrame - If you are scheduling the MIDI Event from the audio unit's render thread, then you can supply a
sample offset that the audio unit may apply when applying that event in its next audio unit render.
This allows you to schedule to the sample, the time when a MIDI command is applied and is particularly
important when starting new notes. If you are not scheduling in the audio unit's render thread,
then you should set this value to 0public static int MusicDeviceSysEx(AudioComponentInstance inUnit, java.lang.String inData, int inLength)
used to send any non-channel MIDI event to an audio unit
This is used to send any non-channel MIDI event to an audio unit. In practise this is a System Exclusive (SysEx) MIDI message
inUnit - The audio unitinData - The complete MIDI SysEx message including the F0 and F7 start and termination bytesinLength - The size, in bytes, of the datapublic static int MusicDeviceStartNote(AudioComponentInstance inUnit, int inInstrument, int inGroupID, org.moe.natj.general.ptr.IntPtr outNoteInstanceID, int inOffsetSampleFrame, MusicDeviceNoteParams inParams)
used to start a note
This function is used to start a note. The caller must provide a NoteInstanceID to receive a token that is then used to stop the note. The MusicDeviceStopNote call should be used to stop notes started with this API. The token can also be used to address individual notes on the kAudioUnitScope_Note if the audio unit supports it. The instrumentID is no longer used and the kMusicNoteEvent_Unused constant should be specified (this takes the current patch for the specifed group as the sound to use for the note).
The Audio unit must provide an unique ID for the note instance ID. This ID must be non-zero and not 0xFFFFFFFF (any other UInt32 value is valid).
Not all Music Device audio units implement the semantics of this API (though it is strongly recommended that they do). A host application shoudl query the kMusicDeviceProperty_SupportsStartStopNote to check that this is supported.
inUnit - The audio unitinInstrument - The instrumentID is no longer used and the kMusicNoteEvent_Unused constant should be specified (this takes
the current patch for the specifed group as the sound to use for the note)inGroupID - The group ID that this note will be attached too. As with MIDI, all notes sounding on a groupID can be
controlled through the various parameters (such as pitch bend, etc) that can be specified on the Group
ScopeoutNoteInstanceID - A pointer to receive the token that is used to identify the note. This parameter must be specifiedinOffsetSampleFrame - If you are scheduling the MIDI Event from the audio unit's render thread, then you can supply a sample offset
that the audio unit may apply when starting the note in its next audio unit render. This allows you to
schedule to the sample and is particularly important when starting new notes. If you are not scheduling
in the audio unit's render thread, then you should set this value to 0inParams - The parameters to be used when starting the note - pitch and velocity must be specifiedpublic static int MusicDeviceStopNote(AudioComponentInstance inUnit, int inGroupID, int inNoteInstanceID, int inOffsetSampleFrame)
used to stop notes started with the MusicDeviceStartNote call
This call is used to stop notes that have been started with the MusicDeviceStartNote call; both the group ID that the note was started on and the noteInstanceID should be specified.
inUnit - The audio unitinGroupID - the group IDinNoteInstanceID - the note instance IDinOffsetSampleFrame - the sample offset within the next buffer rendered that the note should be turned off atpublic static int NewAUGraph(org.moe.natj.general.ptr.Ptr<AUGraph> outGraph)
Create a new AUGraph
outGraph - the new AUGraph objectpublic static int DisposeAUGraph(AUGraph inGraph)
Dispose an AUGraph
Deallocates the AUGraph along with its nodes and their resources.
inGraph - the AUGraph object to be disposedpublic static int AUGraphAddNode(AUGraph inGraph, AudioComponentDescription inDescription, org.moe.natj.general.ptr.IntPtr outNode)
Add a node to an AUGraph
Creates a node in the graph that is an AudioUnit, using the supplied AudioComponentDescription to find and open that unit.
inGraph - the AUGraph objectinDescription - the AudioComponentDescription used to find and open the AudioUnitoutNode - the newly added nodepublic static int AUGraphRemoveNode(AUGraph inGraph, int inNode)
Remove a node from an AUGraph
Nodes can be removed from any thread context. The output node of the AUGraph cannot be removed while the graph is running.
inGraph - the AUGraph objectinNode - the node to be removedpublic static int AUGraphGetNodeCount(AUGraph inGraph, org.moe.natj.general.ptr.IntPtr outNumberOfNodes)
The number of nodes in an AUGraph
inGraph - the AUGraph objectoutNumberOfNodes - the number of nodespublic static int AUGraphGetIndNode(AUGraph inGraph, int inIndex, org.moe.natj.general.ptr.IntPtr outNode)
Returns the node at a given index
By using AUGraphGetNodeCount in conjunction with this call, you can iterate through the nodes of an AUGraph.
inGraph - the AUGraph objectinIndex - the index of the node to retrieveoutNode - the node at that indexpublic static int AUGraphNodeInfo(AUGraph inGraph, int inNode, AudioComponentDescription outDescription, org.moe.natj.general.ptr.Ptr<AudioComponentInstance> outAudioUnit)
Returns information about a particular AUNode
You can pass in NULL for any of the out parameters if you're not interested in that value.
inGraph - the AUGraph objectinNode - the node to queryoutDescription - the component description that would describe the AudioUnit of this nodeoutAudioUnit - the AudioUnit of this nodepublic static int AUGraphConnectNodeInput(AUGraph inGraph, int inSourceNode, int inSourceOutputNumber, int inDestNode, int inDestInputNumber)
connect a node's output to a node's input
public static int AUGraphSetNodeInputCallback(AUGraph inGraph, int inDestNode, int inDestInputNumber, AURenderCallbackStruct inInputCallback)
Set a callback for the specified node's specified input.
inInputCallback - The callback that will provide input data to the nodepublic static int AUGraphDisconnectNodeInput(AUGraph inGraph, int inDestNode, int inDestInputNumber)
disconnect a node's input
This can be used to disconnect either a connection or callback interaction to the specified node input
public static int AUGraphClearConnections(AUGraph inGraph)
clear all of the interactions in a graph
This will clear all connections and callback interactions of the nodes of a graph
public static int AUGraphGetNumberOfInteractions(AUGraph inGraph, org.moe.natj.general.ptr.IntPtr outNumInteractions)
Retrieve the number of interactions of a graph
The number of node interactions currently being managed by the graph
public static int AUGraphGetInteractionInfo(AUGraph inGraph, int inInteractionIndex, org.moe.natj.general.ptr.VoidPtr outInteraction)
Retrieve information about a particular interaction in a graph
Returns information about a particular interaction. inInteractionIndex is based on the outNumInteractions value and is only valid if no edits to the graph's state have been made.
An app can iterate through the interactions (as with the nodes) of a graph by retrieving the number of interactions, and then iterating an index from 0 < numInteractions
outInteraction - the interaction information at the specified indexpublic static int AUGraphCountNodeInteractions(AUGraph inGraph, int inNode, org.moe.natj.general.ptr.IntPtr outNumInteractions)
Retrieve the number of interactions of a graph's node
The number of node interactions currently being managed by the graph for the specified node.
public static int AUGraphGetNodeInteractions(AUGraph inGraph, int inNode, org.moe.natj.general.ptr.IntPtr ioNumInteractions, org.moe.natj.general.ptr.VoidPtr outInteractions)
Retrieve information about the interactions in a graph for a given node
ioNumInteractions - on input, specifies the number of interactions that can be returned
on output, specifies the number of interactions returned.outInteractions - the interactions the specified node is involved inpublic static int AUGraphUpdate(AUGraph inGraph, org.moe.natj.general.ptr.BytePtr outIsUpdated)
Updates the state of a running AUGraph
Call this after performing a series of "edits" on the AUGraph with calls such as AUGraphConnectNodeInput() to finalize those edits. The call will be synchronous if outIsUpdated is NULL, meaning it will block until the changes are incorporated into the graph OR an error is returned from the update process if outIsUpdated is non-NULL, then AUGraphUpdate() will return immediately and outIsUpdated will equal "true" if the changes were already made (no more changes to make) or "false" if changes are still outstanding.
Calling from the AUGraphRenderNotification callback: Connection and Disconnection events can be completely processed in the render notification callback of the AUGraph Nodes can also be removed (except for the output node or a sub-graph of the AUGraph) as well.
Getting kAUGraphErr_CannotDoInCurrentContext as a result code: If AUGraphUpdate returns this result, then it means it was unable to process the update, due to an inability to safely alter the state of the graph (because another thread was accessing a call that relies on the graph's state having integrity). This result code is only a transitory state, which will pass as soon as your other thread's call to AUGraph (that has the lock) completes.
If an error is encountered in the process of an update (say an invalid connection is attempted, a disconnection between nodes that are not connected, etc) on a running graph, then the call will return that error code. It only process events whilst it receives no error results. Thus, if an error is encountered, other events will not be processed until AUGraphUpdate is called again. This is done, in cases where the state of the graph could become inconsistent if further events were processed, so this decision is left up to you. The same applies to the "cant do" error - you have to explicitly call AUGraphUpdate again to have the processing of the events occur.
outIsUpdated - if specified returns true if all of the edits were applied to the graphpublic static int AUGraphOpen(AUGraph inGraph)
Open a graph
AudioUnits are open but not initialized (no resource allocation occurs here)
public static int AUGraphClose(AUGraph inGraph)
Close a graph
All AudioUnits are closed - leaving only its nodal representation
public static int AUGraphInitialize(AUGraph inGraph)
Initialise a graph
AudioUnitInitialize() is called on each opened node/AudioUnit (get ready to render) and SubGraph that are involved in a interaction. If the node is not involved, it is initialised after it becomes involved in an interaction.
A graph must be opened before it can be initialised.
public static int AUGraphUninitialize(AUGraph inGraph)
Uninitialise a graph
The member of the graph are uninitialised
public static int AUGraphStart(AUGraph inGraph)
Start a graph
Start() is called on the "head" node(s) of the AUGraph (now rendering starts)
The graph must be initialised before it can be started.
public static int AUGraphStop(AUGraph inGraph)
Stop a graph
Stop() is called on the "head" node(s) of the AUGraph (rendering is stopped)
public static int AUGraphIsOpen(AUGraph inGraph, org.moe.natj.general.ptr.BytePtr outIsOpen)
Is the graph open
public static int AUGraphIsInitialized(AUGraph inGraph, org.moe.natj.general.ptr.BytePtr outIsInitialized)
Is the graph initialised
public static int AUGraphIsRunning(AUGraph inGraph, org.moe.natj.general.ptr.BytePtr outIsRunning)
Is the graph running (has it been started)
public static int AUGraphGetCPULoad(AUGraph inGraph, org.moe.natj.general.ptr.FloatPtr outAverageCPULoad)
The CPU load of the graph
Returns a short-term running average of the current CPU load of the graph.
public static int AUGraphGetMaxCPULoad(AUGraph inGraph, org.moe.natj.general.ptr.FloatPtr outMaxLoad)
The Maximum CPU load of the graph
Returns the max CPU load of the graph since this call was last made or the graph was last started.
public static int AUGraphAddRenderNotify(AUGraph inGraph, AudioToolbox.Function_AUGraphAddRenderNotify inCallback, org.moe.natj.general.ptr.VoidPtr inRefCon)
Add a notification callback
Add a callback that the graph will call every time the graph renders. The callback will be called once before the graph's render operation, and once after the render operation is complete.
public static int AUGraphRemoveRenderNotify(AUGraph inGraph, AudioToolbox.Function_AUGraphRemoveRenderNotify inCallback, org.moe.natj.general.ptr.VoidPtr inRefCon)
Remove a notification callback
Remove a previously added callback. You must provide both the callback and the refCon that was used previously to add the callback.
public static int AudioConverterNew(AudioStreamBasicDescription inSourceFormat, AudioStreamBasicDescription inDestinationFormat, org.moe.natj.general.ptr.Ptr<AudioConverterRef> outAudioConverter)
Create a new AudioConverter.
inSourceFormat - The format of the source audio to be converted.inDestinationFormat - The destination format to which the audio is to be converted.outAudioConverter - On successful return, points to a new AudioConverter instance.For a pair of linear PCM formats, the following conversions are supported:
Also, encoding and decoding between linear PCM and compressed formats is supported. Functions in AudioToolbox/AudioFormat.h return information about the supported formats. When using a codec, you can use any supported PCM format (as above); the converter will perform any necessary additional conversion between your PCM format and the one created or consumed by the codec.
public static int AudioConverterNewSpecific(AudioStreamBasicDescription inSourceFormat, AudioStreamBasicDescription inDestinationFormat, int inNumberClassDescriptions, AudioClassDescription inClassDescriptions, org.moe.natj.general.ptr.Ptr<AudioConverterRef> outAudioConverter)
Create a new AudioConverter using specific codecs.
inSourceFormat - The format of the source audio to be converted.inDestinationFormat - The destination format to which the audio is to be converted.inNumberClassDescriptions - The number of class descriptions.inClassDescriptions - AudioClassDescriptions specifiying the codec to instantiate.outAudioConverter - On successful return, points to a new AudioConverter instance.This function is identical to AudioConverterNew(), except that the client may explicitly choose which codec to instantiate if there is more than one choice.
public static int AudioConverterDispose(AudioConverterRef inAudioConverter)
Destroy an AudioConverter.
inAudioConverter - The AudioConverter to dispose.public static int AudioConverterReset(AudioConverterRef inAudioConverter)
Reset an AudioConverter
inAudioConverter - The AudioConverter to reset.Should be called whenever there is a discontinuity in the source audio stream being provided to the converter. This will flush any internal buffers in the converter.
public static int AudioConverterGetPropertyInfo(AudioConverterRef inAudioConverter, int inPropertyID, org.moe.natj.general.ptr.IntPtr outSize, org.moe.natj.general.ptr.BytePtr outWritable)
Returns information about an AudioConverter property.
inAudioConverter - The AudioConverter to query.inPropertyID - The property to query.outSize - If non-null, on exit, the maximum size of the property value in bytes.outWritable - If non-null, on exit, indicates whether the property value is writable.public static int AudioConverterGetProperty(AudioConverterRef inAudioConverter, int inPropertyID, org.moe.natj.general.ptr.IntPtr ioPropertyDataSize, org.moe.natj.general.ptr.VoidPtr outPropertyData)
Returns an AudioConverter property value.
inAudioConverter - The AudioConverter to query.inPropertyID - The property to fetch.ioPropertyDataSize - On entry, the size of the memory pointed to by outPropertyData. On
successful exit, the size of the property value.outPropertyData - On exit, the property value.public static int AudioConverterSetProperty(AudioConverterRef inAudioConverter, int inPropertyID, int inPropertyDataSize, org.moe.natj.general.ptr.ConstVoidPtr inPropertyData)
Sets an AudioConverter property value.
inAudioConverter - The AudioConverter to modify.inPropertyID - The property to set.inPropertyDataSize - The size in bytes of the property value.inPropertyData - Points to the new property value.public static int AudioConverterConvertBuffer(AudioConverterRef inAudioConverter, int inInputDataSize, org.moe.natj.general.ptr.ConstVoidPtr inInputData, org.moe.natj.general.ptr.IntPtr ioOutputDataSize, org.moe.natj.general.ptr.VoidPtr outOutputData)
Converts data from an input buffer to an output buffer.
inAudioConverter - The AudioConverter to use.inInputDataSize - The size of the buffer inInputData.inInputData - The input audio data buffer.ioOutputDataSize - On entry, the size of the buffer outOutputData. On exit, the number of bytes
written to outOutputData.outOutputData - The output data buffer.WARNING: this function will fail for any conversion where there is a variable relationship between the input and output data buffer sizes. This includes sample rate conversions and most compressed formats. In these cases, use AudioConverterFillComplexBuffer. Generally this function is only appropriate for PCM-to-PCM conversions where there is no sample rate conversion.
public static int AudioConverterFillComplexBuffer(AudioConverterRef inAudioConverter, AudioToolbox.Function_AudioConverterFillComplexBuffer inInputDataProc, org.moe.natj.general.ptr.VoidPtr inInputDataProcUserData, org.moe.natj.general.ptr.IntPtr ioOutputDataPacketSize, AudioBufferList outOutputData, AudioStreamPacketDescription outPacketDescription)
Converts data supplied by an input callback function, supporting non-interleaved and packetized formats.
inAudioConverter - The AudioConverter to use.inInputDataProc - A callback function which supplies the input data.inInputDataProcUserData - A value for the use of the callback function.ioOutputDataPacketSize - On entry, the capacity of outOutputData expressed in packets in the
converter's output format. On exit, the number of packets of converted
data that were written to outOutputData.outOutputData - The converted output data is written to this buffer. On entry, the buffers'
mDataByteSize fields (which must all be the same) reflect buffer capacity.
On exit, mDataByteSize is set to the number of bytes written.outPacketDescription - If non-null, and the converter's output uses packet descriptions, then
packet descriptions are written to this array. It must point to a memory
block capable of holding *ioOutputDataPacketSize packet descriptions.
(See AudioFormat.h for ways to determine whether an audio format
uses packet descriptions).Produces a buffer list of output data from an AudioConverter. The supplied input callback function is called whenever necessary.
public static int AudioConverterConvertComplexBuffer(AudioConverterRef inAudioConverter, int inNumberPCMFrames, AudioBufferList inInputData, AudioBufferList outOutputData)
Converts PCM data from an input buffer list to an output buffer list.
[@warning] This function will fail for any conversion where there is a variable relationship between the input and output data buffer sizes. This includes sample rate conversions and most compressed formats. In these cases, use AudioConverterFillComplexBuffer. Generally this function is only appropriate for PCM-to-PCM conversions where there is no sample rate conversion.
inAudioConverter - The AudioConverter to use.inNumberPCMFrames - The number of PCM frames to convert.inInputData - The source audio buffer list.outOutputData - The converted output data is written to this buffer list.public static long NumBytesToNumAudioFileMarkers(long inNumBytes)
public static long NumAudioFileMarkersToNumBytes(long inNumMarkers)
public static AudioFileRegion NextAudioFileRegion(AudioFileRegion inAFRegionPtr)
public static int AudioFileCreateWithURL(CFURLRef inFileRef, int inFileType, AudioStreamBasicDescription inFormat, int inFlags, org.moe.natj.general.ptr.Ptr<AudioFileID> outAudioFile)
creates a new audio file (or initialises an existing file)
creates a new (or initialises an existing) audio file specified by the URL. Upon success, an AudioFileID is returned which can be used for subsequent calls to the AudioFile APIs.
inFileRef - an CFURLRef fully specifying the path of the file to create/initialiseinFileType - an AudioFileTypeID indicating the type of audio file to create.inFormat - an AudioStreamBasicDescription describing the data format that will be
added to the audio file.inFlags - relevant flags for creating/opening the file.
if kAudioFileFlags_EraseFile is set, it will erase an existing file
if not set, then the Create call will fail if the URL is an existing fileoutAudioFile - if successful, an AudioFileID that can be used for subsequent AudioFile calls.public static int AudioFileOpenURL(CFURLRef inFileRef, byte inPermissions, int inFileTypeHint, org.moe.natj.general.ptr.Ptr<AudioFileID> outAudioFile)
Open an existing audio file.
Open an existing audio file for reading or reading and writing.
inFileRef - the CFURLRef of an existing audio file.inPermissions - use the permission constantsinFileTypeHint - For files which have no filename extension and whose type cannot be easily or
uniquely determined from the data (ADTS,AC3), this hint can be used to indicate the file type.
Otherwise you can pass zero for this. The hint is only used on OS versions 10.3.1 or greater.
For OS versions prior to that, opening files of the above description will fail.outAudioFile - upon success, an AudioFileID that can be used for subsequent
AudioFile calls.public static int AudioFileInitializeWithCallbacks(org.moe.natj.general.ptr.VoidPtr inClientData,
AudioToolbox.Function_AudioFileInitializeWithCallbacks_1 inReadFunc,
AudioToolbox.Function_AudioFileInitializeWithCallbacks_2 inWriteFunc,
AudioToolbox.Function_AudioFileInitializeWithCallbacks_3 inGetSizeFunc,
AudioToolbox.Function_AudioFileInitializeWithCallbacks_4 inSetSizeFunc,
int inFileType,
AudioStreamBasicDescription inFormat,
int inFlags,
org.moe.natj.general.ptr.Ptr<AudioFileID> outAudioFile)
Wipe clean an existing file. You provide callbacks that the AudioFile API will use to get the data.
inClientData - a constant that will be passed to your callbacks.inReadFunc - a function that will be called when AudioFile needs to read data.inWriteFunc - a function that will be called when AudioFile needs to write data.inGetSizeFunc - a function that will be called when AudioFile needs to know the file size.inSetSizeFunc - a function that will be called when AudioFile needs to set the file size.inFileType - an AudioFileTypeID indicating the type of audio file to which to initialize the file.inFormat - an AudioStreamBasicDescription describing the data format that will be
added to the audio file.inFlags - flags for creating/opening the file. Currently zero.outAudioFile - upon success, an AudioFileID that can be used for subsequent
AudioFile calls.public static int AudioFileOpenWithCallbacks(org.moe.natj.general.ptr.VoidPtr inClientData,
AudioToolbox.Function_AudioFileOpenWithCallbacks_1 inReadFunc,
AudioToolbox.Function_AudioFileOpenWithCallbacks_2 inWriteFunc,
AudioToolbox.Function_AudioFileOpenWithCallbacks_3 inGetSizeFunc,
AudioToolbox.Function_AudioFileOpenWithCallbacks_4 inSetSizeFunc,
int inFileTypeHint,
org.moe.natj.general.ptr.Ptr<AudioFileID> outAudioFile)
Open an existing file. You provide callbacks that the AudioFile API will use to get the data.
inClientData - a constant that will be passed to your callbacks.inReadFunc - a function that will be called when AudioFile needs to read data.inWriteFunc - a function that will be called when AudioFile needs to write data.inGetSizeFunc - a function that will be called when AudioFile needs to know the total file size.inSetSizeFunc - a function that will be called when AudioFile needs to set the file size.inFileTypeHint - For files which have no filename extension and whose type cannot be easily or
uniquely determined from the data (ADTS,AC3), this hint can be used to indicate the file type.
Otherwise you can pass zero for this. The hint is only used on OS versions 10.3.1 or greater.
For OS versions prior to that, opening files of the above description will fail.outAudioFile - upon success, an AudioFileID that can be used for subsequent
AudioFile calls.public static int AudioFileClose(AudioFileID inAudioFile)
Close an existing audio file.
inAudioFile - an AudioFileID.public static int AudioFileOptimize(AudioFileID inAudioFile)
Move the audio data to the end of the file and other internal optimizations of the file structure.
Optimize the file so additional audio data can be appended to the existing data. Generally, this will place the audio data at the end of the file so additional writes can be placed to the file end. This can be a potentially expensive and time-consuming operation and should not be used during time critical operations. There is a kAudioFilePropertyIsOptimized property for checking on the optimized state of the file.
inAudioFile - an AudioFileID.public static int AudioFileReadBytes(AudioFileID inAudioFile, byte inUseCache, long inStartingByte, org.moe.natj.general.ptr.IntPtr ioNumBytes, org.moe.natj.general.ptr.VoidPtr outBuffer)
Read bytes of audio data from the audio file.
Returns kAudioFileEndOfFileError when read encounters end of file.
inAudioFile - an AudioFileID.inUseCache - true if it is desired to cache the data upon read, else falseinStartingByte - the byte offset of the audio data desired to be returnedioNumBytes - on input, the number of bytes to read, on output, the number of
bytes actually read.outBuffer - outBuffer should be a void * to user allocated memory large enough for the requested bytes.public static int AudioFileWriteBytes(AudioFileID inAudioFile, byte inUseCache, long inStartingByte, org.moe.natj.general.ptr.IntPtr ioNumBytes, org.moe.natj.general.ptr.ConstVoidPtr inBuffer)
Write bytes of audio data to the audio file.
inAudioFile - an AudioFileID.inUseCache - true if it is desired to cache the data upon write, else falseinStartingByte - the byte offset where the audio data should be writtenioNumBytes - on input, the number of bytes to write, on output, the number of
bytes actually written.inBuffer - inBuffer should be a void * containing the bytes to be writtenpublic static int AudioFileReadPacketData(AudioFileID inAudioFile, byte inUseCache, org.moe.natj.general.ptr.IntPtr ioNumBytes, org.moe.natj.general.ptr.Ptr<AudioStreamPacketDescription> outPacketDescriptions, long inStartingPacket, org.moe.natj.general.ptr.IntPtr ioNumPackets, org.moe.natj.general.ptr.VoidPtr outBuffer)
Read packets of audio data from the audio file.
AudioFileReadPacketData reads as many of the requested number of packets as will fit in the buffer size given by ioNumPackets. Unlike the deprecated AudioFileReadPackets, ioNumPackets must be initialized. If the byte size of the number packets requested is less than the buffer size, ioNumBytes will be reduced. If the buffer is too small for the number of packets requested, ioNumPackets and ioNumBytes will be reduced to the number of packets that can be accommodated and their byte size. Returns kAudioFileEndOfFileError when read encounters end of file. For all uncompressed formats, packets == frames.
inAudioFile - an AudioFileID.inUseCache - true if it is desired to cache the data upon read, else falseioNumBytes - on input the size of outBuffer in bytes.
on output, the number of bytes actually returned.outPacketDescriptions - An array of packet descriptions describing the packets being returned.
The size of the array must be greater or equal to the number of packets requested.
On return the packet description will be filled out with the packet offsets and sizes.
Packet descriptions are ignored for CBR data.inStartingPacket - The packet index of the first packet desired to be returnedioNumPackets - on input, the number of packets to read, on output, the number of
packets actually read.outBuffer - outBuffer should be a pointer to user allocated memory.@Deprecated public static int AudioFileReadPackets(AudioFileID inAudioFile, byte inUseCache, org.moe.natj.general.ptr.IntPtr outNumBytes, org.moe.natj.general.ptr.Ptr<AudioStreamPacketDescription> outPacketDescriptions, long inStartingPacket, org.moe.natj.general.ptr.IntPtr ioNumPackets, org.moe.natj.general.ptr.VoidPtr outBuffer)
Read packets of audio data from the audio file.
AudioFileReadPackets is DEPRECATED. Use AudioFileReadPacketData instead. READ THE HEADER DOC FOR AudioFileReadPacketData. It is not a drop-in replacement. In particular, for AudioFileReadPacketData ioNumBytes must be initialized to the buffer size. AudioFileReadPackets assumes you have allocated your buffer to ioNumPackets times the maximum packet size. For many compressed formats this will only use a portion of the buffer since the ratio of the maximum packet size to the typical packet size can be large. Use AudioFileReadPacketData instead.
inAudioFile - an AudioFileID.inUseCache - true if it is desired to cache the data upon read, else falseoutNumBytes - on output, the number of bytes actually returnedoutPacketDescriptions - on output, an array of packet descriptions describing
the packets being returned. NULL may be passed for this
parameter. Nothing will be returned for linear pcm data.inStartingPacket - the packet index of the first packet desired to be returnedioNumPackets - on input, the number of packets to read, on output, the number of
packets actually read.outBuffer - outBuffer should be a pointer to user allocated memory of size:
number of packets requested times file's maximum (or upper bound on)
packet size.public static int AudioFileWritePackets(AudioFileID inAudioFile, byte inUseCache, int inNumBytes, org.moe.natj.general.ptr.ConstPtr<AudioStreamPacketDescription> inPacketDescriptions, long inStartingPacket, org.moe.natj.general.ptr.IntPtr ioNumPackets, org.moe.natj.general.ptr.ConstVoidPtr inBuffer)
Write packets of audio data to the audio file.
For all uncompressed formats, packets == frames.
inAudioFile - an AudioFileID.inUseCache - true if it is desired to cache the data upon write, else falseinNumBytes - the number of bytes being provided for writeinPacketDescriptions - an array of packet descriptions describing the packets being
provided. Not all formats require packet descriptions to be
provided. NULL may be passed if no descriptions are required.inStartingPacket - the packet index of where the first packet provided should be placed.ioNumPackets - on input, the number of packets to write, on output, the number of
packets actually written.inBuffer - a void * to user allocated memory containing the packets to write.public static int AudioFileCountUserData(AudioFileID inAudioFile, int inUserDataID, org.moe.natj.general.ptr.IntPtr outNumberItems)
Get the number of user data items with a certain ID in the file
"User Data" refers to chunks in AIFF, CAF and WAVE files, or resources in Sound Designer II files, and possibly other things in other files. For simplicity, referred to below as "chunks".
inAudioFile - an AudioFileID.inUserDataID - the four char code of the chunk.outNumberItems - on output, if successful, number of chunks of this type in the file.public static int AudioFileGetUserDataSize(AudioFileID inAudioFile, int inUserDataID, int inIndex, org.moe.natj.general.ptr.IntPtr outUserDataSize)
Get the size of user data in a file
inAudioFile - an AudioFileID.inUserDataID - the four char code of the chunk.inIndex - an index specifying which chunk if there are more than one.outUserDataSize - on output, if successful, the size of the user data chunk.public static int AudioFileGetUserData(AudioFileID inAudioFile, int inUserDataID, int inIndex, org.moe.natj.general.ptr.IntPtr ioUserDataSize, org.moe.natj.general.ptr.VoidPtr outUserData)
Get the data of a chunk in a file.
inAudioFile - an AudioFileID.inUserDataID - the four char code of the chunk.inIndex - an index specifying which chunk if there are more than one.outUserData - a pointer to a buffer in which to copy the chunk data.ioUserDataSize - the size of the buffer on input, size of bytes copied to buffer on outputpublic static int AudioFileSetUserData(AudioFileID inAudioFile, int inUserDataID, int inIndex, int inUserDataSize, org.moe.natj.general.ptr.ConstVoidPtr inUserData)
Set the data of a chunk in a file.
inAudioFile - an AudioFileID.inUserDataID - the four char code of the chunk.inIndex - an index specifying which chunk if there are more than one.inUserData - a pointer to a buffer from which to copy the chunk data
(only the contents of the chunk, not including the chunk header).inUserDataSize - on input the size of the data to copy, on output, size of bytes copied from the bufferpublic static int AudioFileRemoveUserData(AudioFileID inAudioFile, int inUserDataID, int inIndex)
Remove a user chunk in a file.
inAudioFile - an AudioFileID.inUserDataID - the four char code of the chunk.inIndex - an index specifying which chunk if there are more than one.public static int AudioFileGetPropertyInfo(AudioFileID inAudioFile, int inPropertyID, org.moe.natj.general.ptr.IntPtr outDataSize, org.moe.natj.general.ptr.IntPtr isWritable)
Get information about the size of a property of an AudioFile and whether it can be set.
inAudioFile - an AudioFileID.inPropertyID - an AudioFileProperty constant.outDataSize - the size in bytes of the current value of the property. In order to get the property value,
you will need a buffer of this size.isWritable - will be set to 1 if writable, or 0 if read only.public static int AudioFileGetProperty(AudioFileID inAudioFile, int inPropertyID, org.moe.natj.general.ptr.IntPtr ioDataSize, org.moe.natj.general.ptr.VoidPtr outPropertyData)
Copies the value for a property of an AudioFile into a buffer.
inAudioFile - an AudioFileID.inPropertyID - an AudioFileProperty constant.ioDataSize - on input the size of the outPropertyData buffer. On output the number of bytes written to the buffer.outPropertyData - the buffer in which to write the property data.public static int AudioFileSetProperty(AudioFileID inAudioFile, int inPropertyID, int inDataSize, org.moe.natj.general.ptr.ConstVoidPtr inPropertyData)
Sets the value for a property of an AudioFile .
inAudioFile - an AudioFileID.inPropertyID - an AudioFileProperty constant.inDataSize - the size of the property data.inPropertyData - the buffer containing the property data.public static int AudioFileGetGlobalInfoSize(int inPropertyID,
int inSpecifierSize,
org.moe.natj.general.ptr.VoidPtr inSpecifier,
org.moe.natj.general.ptr.IntPtr outDataSize)
Get the size of a global property.
inPropertyID - an AudioFileGlobalInfo property constant.inSpecifierSize - The size of the specifier data.inSpecifier - A specifier is a buffer of data used as an input argument to some of the global info properties.outDataSize - the size in bytes of the current value of the property. In order to get the property value,
you will need a buffer of this size.public static int AudioFileGetGlobalInfo(int inPropertyID,
int inSpecifierSize,
org.moe.natj.general.ptr.VoidPtr inSpecifier,
org.moe.natj.general.ptr.IntPtr ioDataSize,
org.moe.natj.general.ptr.VoidPtr outPropertyData)
Copies the value for a global property into a buffer.
inPropertyID - an AudioFileGlobalInfo property constant.inSpecifierSize - The size of the specifier data.inSpecifier - A specifier is a buffer of data used as an input argument to some of the global info properties.ioDataSize - on input the size of the outPropertyData buffer. On output the number of bytes written to the buffer.outPropertyData - the buffer in which to write the property data.public static int AudioFileStreamOpen(org.moe.natj.general.ptr.VoidPtr inClientData,
AudioToolbox.Function_AudioFileStreamOpen_1 inPropertyListenerProc,
AudioToolbox.Function_AudioFileStreamOpen_2 inPacketsProc,
int inFileTypeHint,
org.moe.natj.general.ptr.Ptr<AudioFileStreamID> outAudioFileStream)
Create a new audio file stream parser. The client provides the parser with data and the parser calls callbacks when interesting things are found in the data, such as properties and audio packets.
inFileTypeHint - For files whose type cannot be easily or uniquely determined from the data (ADTS,AC3),
this hint can be used to indicate the file type.
Otherwise if you do not know the file type, you can pass zero.inClientData - a constant that will be passed to your callbacks.inPropertyListenerProc - Whenever the value of a property is parsed in the data, this function will be called.
You can then get the value of the property from in the callback. In some cases, due to
boundaries in the input data, the property may return kAudioFileStreamError_DataUnavailable.
When unavailable data is requested from within the property listener, the parser will begin
caching the property value and will call the property listener again when the property is
available. For property values for which kAudioFileStreamPropertyFlag_PropertyIsCached is unset, this
will be the only opportunity to get the value of the property, since the data will be
disposed upon return of the property listener callback.inPacketsProc - Whenever packets are parsed in the data, a pointer to the packets is passed to the client
using this callback. At times only a single packet may be passed due to boundaries in the
input data.outAudioFileStream - A new file stream ID for use in other AudioFileStream API calls.public static int AudioFileStreamParseBytes(AudioFileStreamID inAudioFileStream, int inDataByteSize, org.moe.natj.general.ptr.ConstVoidPtr inData, int inFlags)
This call is the means for streams to supply data to the parser. Data is expected to be passed in sequentially from the beginning of the file, without gaps. In the course of parsing, the client's property and/or packets callbacks may be called. At the end of the stream, this function must be called once with null data pointer and zero data byte size to flush any remaining packets out of the parser.
inAudioFileStream - The file stream IDinDataByteSize - The number of bytes passed in for parsing. Must be zero when flushing the parser.inData - The data passed in to be parsed. Must be null when flushing the parser.inFlags - If there is a data discontinuity, then kAudioFileStreamParseFlag_Discontinuity should be set true.public static int AudioFileStreamSeek(AudioFileStreamID inAudioFileStream, long inPacketOffset, org.moe.natj.general.ptr.LongPtr outDataByteOffset, org.moe.natj.general.ptr.IntPtr ioFlags)
This call is used to seek in the data stream. The client passes in a packet offset to seek to and the parser passes back a byte offset from which to get the data to satisfy that request. The data passed to the next call to AudioFileParseBytes will be assumed to be from that byte offset. For file formats which do not contain packet tables the byte offset may be an estimate. If so, the flag kAudioFileStreamSeekFlag_OffsetIsEstimated will be true.
inAudioFileStream - The file stream IDinPacketOffset - The offset from the beginning of the file of the packet to which to seek.outDataByteOffset - The byte offset of the data from the file's data offset returned.
You need to add the value of kAudioFileStreamProperty_DataOffset to get an absolute byte offset in the file.ioFlags - If outDataByteOffset is an estimate, then kAudioFileStreamSeekFlag_OffsetIsEstimated will be set on output.
There are currently no flags defined for passing into this call.public static int AudioFileStreamGetPropertyInfo(AudioFileStreamID inAudioFileStream, int inPropertyID, org.moe.natj.general.ptr.IntPtr outPropertyDataSize, org.moe.natj.general.ptr.BytePtr outWritable)
Retrieve the info about the given property. The outSize argument will return the size in bytes of the current value of the property.
inAudioFileStream - The file stream IDinPropertyID - Property ID whose value should be readoutPropertyDataSize - Size in bytes of the propertyoutWritable - whether the property is writablepublic static int AudioFileStreamGetProperty(AudioFileStreamID inAudioFileStream, int inPropertyID, org.moe.natj.general.ptr.IntPtr ioPropertyDataSize, org.moe.natj.general.ptr.VoidPtr outPropertyData)
Retrieve the indicated property data.
inAudioFileStream - The file stream IDinPropertyID - Property ID whose value should be readioPropertyDataSize - On input, the size of the buffer pointed to by outPropertyData. On output,
the number of bytes written.outPropertyData - Pointer to the property data bufferpublic static int AudioFileStreamSetProperty(AudioFileStreamID inAudioFileStream, int inPropertyID, int inPropertyDataSize, org.moe.natj.general.ptr.ConstVoidPtr inPropertyData)
Set the value of the property. There are currently no settable properties.
inAudioFileStream - The file stream IDinPropertyID - Property ID whose value should be setinPropertyDataSize - Size in bytes of the property datainPropertyData - Pointer to the property data bufferpublic static int AudioFileStreamClose(AudioFileStreamID inAudioFileStream)
Close and deallocate the file stream object.
inAudioFileStream - The file stream IDpublic static int AudioFormatGetPropertyInfo(int inPropertyID,
int inSpecifierSize,
org.moe.natj.general.ptr.ConstVoidPtr inSpecifier,
org.moe.natj.general.ptr.IntPtr outPropertyDataSize)
Retrieve information about the given property
inPropertyID - an AudioFormatPropertyID constant.inSpecifierSize - The size of the specifier data.inSpecifier - A specifier is a buffer of data used as an input argument to some of the properties.outPropertyDataSize - The size in bytes of the current value of the property. In order to get the property value,
you will need a buffer of this size.public static int AudioFormatGetProperty(int inPropertyID,
int inSpecifierSize,
org.moe.natj.general.ptr.ConstVoidPtr inSpecifier,
org.moe.natj.general.ptr.IntPtr ioPropertyDataSize,
org.moe.natj.general.ptr.VoidPtr outPropertyData)
Retrieve the indicated property data
inPropertyID - an AudioFormatPropertyID constant.inSpecifierSize - The size of the specifier data.inSpecifier - A specifier is a buffer of data used as an input argument to some of the properties.ioPropertyDataSize - on input the size of the outPropertyData buffer. On output the number of bytes written to the buffer.outPropertyData - the buffer in which to write the property data. If outPropertyData is NULL and ioPropertyDataSize is
not, the amount that would have been written will be reported.public static int AudioQueueNewOutput(AudioStreamBasicDescription inFormat, AudioToolbox.Function_AudioQueueNewOutput inCallbackProc, org.moe.natj.general.ptr.VoidPtr inUserData, CFRunLoopRef inCallbackRunLoop, CFStringRef inCallbackRunLoopMode, int inFlags, org.moe.natj.general.ptr.Ptr<AudioQueueRef> outAQ)
Creates a new audio queue for playing audio data.
To create an playback audio queue, you allocate buffers, then queue buffers (using AudioQueueEnqueueBuffer). The callback receives buffers and typically queues them again. To schedule a buffer for playback, providing parameter and start time information, call AudioQueueEnqueueBufferWithParameters.
inFormat - A pointer to a structure describing the format of the audio data to be played. For
linear PCM, only interleaved formats are supported. Compressed formats are supported.inCallbackProc - A pointer to a callback function to be called when the audio queue has finished playing
a buffer.inUserData - A value or pointer to data that you specify to be passed to the callback function.inCallbackRunLoop - The event loop on which inCallbackProc is to be called. If you specify NULL, the
callback is called on one of the audio queue's internal threads.inCallbackRunLoopMode - The run loop mode in which to call the callback. Typically, you pass
kCFRunLoopCommonModes. (NULL also specifies kCFRunLoopCommonModes). Other
possibilities are implementation specific. You can choose to create your own thread with
your own run loops. For more information on run loops, see Run Loops or CFRunLoop
Reference.inFlags - Reserved for future use. Pass 0.outAQ - On return, this variable contains a pointer to the newly created playback audio queue
object.public static int AudioQueueNewInput(AudioStreamBasicDescription inFormat, AudioToolbox.Function_AudioQueueNewInput inCallbackProc, org.moe.natj.general.ptr.VoidPtr inUserData, CFRunLoopRef inCallbackRunLoop, CFStringRef inCallbackRunLoopMode, int inFlags, org.moe.natj.general.ptr.Ptr<AudioQueueRef> outAQ)
Creates a new audio queue for recording audio data.
Outline of how to use the queue for input:
- create input queue - allocate buffers - enqueue buffers (AudioQueueEnqueueBuffer, not with parameters, no packet descriptions) - the callback receives buffers and re-enqueues them
inFormat - A pointer to a structure describing the format of the audio data to be recorded. For
linear PCM, only interleaved formats are supported. Compressed formats are supported.inCallbackProc - A pointer to a callback function to be called when the audio queue has finished filling
a buffer.inUserData - A value or pointer to data that you specify to be passed to the callback function.inCallbackRunLoop - The event loop on which inCallbackProc is to be called. If you specify NULL, the
callback is called on one of the audio queue's internal threads.inCallbackRunLoopMode - The run loop mode in which to call the callback. Typically, you pass
kCFRunLoopCommonModes. (NULL also specifies kCFRunLoopCommonModes). Other
possibilities are implementation specific. You can choose to create your own thread with
your own run loops. For more information on run loops, see Run Loops or CFRunLoop
Reference.inFlags - Reserved for future use. Pass 0.outAQ - On return, this variable contains a pointer to the newly created recording audio queue
object.public static int AudioQueueNewOutputWithDispatchQueue(org.moe.natj.general.ptr.Ptr<AudioQueueRef> outAQ, AudioStreamBasicDescription inFormat, int inFlags, NSObject inCallbackDispatchQueue, AudioToolbox.Block_AudioQueueNewOutputWithDispatchQueue inCallbackBlock)
Creates a new audio queue for playing audio data.
To create an playback audio queue, you allocate buffers, then queue buffers (using AudioQueueEnqueueBuffer). The callback receives buffers and typically queues them again. To schedule a buffer for playback, providing parameter and start time information, call AudioQueueEnqueueBufferWithParameters.
outAQ - On return, this variable contains a pointer to the newly created playback audio queue
object.inFormat - A pointer to a structure describing the format of the audio data to be played. For
linear PCM, only interleaved formats are supported. Compressed formats are supported.inFlags - Reserved for future use. Pass 0.inCallbackDispatchQueue - The dispatch queue from which inCallbackBlock is to be called.inCallbackBlock - A pointer to a callback block to be called when the audio queue has finished playing
a buffer.public static int AudioQueueNewInputWithDispatchQueue(org.moe.natj.general.ptr.Ptr<AudioQueueRef> outAQ, AudioStreamBasicDescription inFormat, int inFlags, NSObject inCallbackDispatchQueue, AudioToolbox.Block_AudioQueueNewInputWithDispatchQueue inCallbackBlock)
Creates a new audio queue for recording audio data.
Outline of how to use the queue for input:
- create input queue - allocate buffers - enqueue buffers (AudioQueueEnqueueBuffer, not with parameters, no packet descriptions) - the callback receives buffers and re-enqueues them
outAQ - On return, this variable contains a pointer to the newly created recording audio queue
object.inFormat - A pointer to a structure describing the format of the audio data to be recorded. For
linear PCM, only interleaved formats are supported. Compressed formats are supported.inFlags - Reserved for future use. Pass 0.inCallbackDispatchQueue - The dispatch queue from which inCallbackBlock is to be called.inCallbackBlock - A pointer to a callback block to be called when the audio queue has finished filling
a buffer.public static int AudioQueueDispose(AudioQueueRef inAQ, byte inImmediate)
Disposes an existing audio queue.
Disposing of the audio queue also disposes of all its resources, including its buffers.
inAQ - The audio queue you want to dispose ofinImmediate - If you pass true, the audio queue is disposed of immediately (that is, synchronously).
If you pass false, disposal does not take place until all enqueued buffers are
processed. Whether you call AudioQueueDispose synchronously or asynchronously, you can
no longer interact with the queue, and the queue no longer invokes any callbacks to your
application after the function returns.
Note that if AudioQueueDispose is called from a buffer completion callback or property listener, you may receive further callbacks afterwards.
public static int AudioQueueAllocateBuffer(AudioQueueRef inAQ, int inBufferByteSize, org.moe.natj.general.ptr.Ptr<org.moe.natj.general.ptr.Ptr<AudioQueueBuffer>> outBuffer)
Asks an audio queue to allocate a buffer.
Once allocated, the pointer to the buffer and the buffer's size are fixed and cannot be changed. The mAudioDataByteSize field in the audio queue buffer structure, AudioQueueBuffer, is initially set to 0.
inAQ - The audio queue you want to allocate a buffer.inBufferByteSize - The desired size of the new buffer, in bytes. An appropriate buffer size depends on the
processing you will perform on the data as well as on the audio data format.outBuffer - On return, points to the newly created audio buffer. The mAudioDataByteSize field in the
audio queue buffer structure, AudioQueueBuffer, is initially set to 0.public static int AudioQueueAllocateBufferWithPacketDescriptions(AudioQueueRef inAQ, int inBufferByteSize, int inNumberPacketDescriptions, org.moe.natj.general.ptr.Ptr<org.moe.natj.general.ptr.Ptr<AudioQueueBuffer>> outBuffer)
Asks an audio queue to allocate a buffer with space for packet descriptions.
Once allocated, the pointer to the buffer and the buffer's size are fixed and cannot be changed. The mAudioDataByteSize field in the audio queue buffer structure, AudioQueueBuffer, is initially set to 0.
inAQ - The audio queue you want to allocate a buffer.inBufferByteSize - The desired size of the new buffer, in bytes. An appropriate buffer size depends on the
processing you will perform on the data as well as on the audio data format.inNumberPacketDescriptions - The desired capacity of the packet description array in the new buffer.outBuffer - On return, points to the newly created audio buffer. The mAudioDataByteSize field in the
audio queue buffer structure, AudioQueueBuffer, is initially set to 0.public static int AudioQueueFreeBuffer(AudioQueueRef inAQ, AudioQueueBuffer inBuffer)
Disposes of an audio queue buffer.
This function disposes of the buffer allocated by AudioQueueAllocateBuffer. Disposing of an audio queue also automatically disposes of any associated buffers and timeline objects. Call this function only if you want to dispose of a particular buffer while continuing to use an audio queue. You can dispose of buffers only when the associated queue is stopped (that is, not processing audio data).
inAQ - The queue from which the buffer was allocated.inBuffer - The buffer to be disposed.public static int AudioQueueEnqueueBuffer(AudioQueueRef inAQ, AudioQueueBuffer inBuffer, int inNumPacketDescs, AudioStreamPacketDescription inPacketDescs)
Assigns a buffer to an audio queue for recording or playback.
If the buffer was allocated with AudioQueueAllocateBufferWithPacketDescriptions, the client should provide packet descriptions in the buffer's mPacketDescriptions and mPacketDescriptionCount fields rather than in inPacketDescs and inNumPacketDescs, which should be NULL and 0, respectively, in this case.
For an input queue, pass 0 and NULL for inNumPacketDescs and inPacketDescs, respectively. Your callback will receive packet descriptions owned by the audio queue.
inAQ - The audio queue you are assigning the buffer to.inBuffer - The buffer to queue (that is, to be recorded into or played from).inNumPacketDescs - The number of packet descriptions pointed to by the inPacketDescs pointer. Applicable
only for output queues and required only for variable-bit-rate (VBR) audio formats. Pass
0 for input queues (no packet descriptions are required).inPacketDescs - An array of packet descriptions. Applicable only for output queues and required only for
variable-bit-rate (VBR) audio formats. Pass NULL for input queues (no packet
descriptions are required).public static int AudioQueueEnqueueBufferWithParameters(AudioQueueRef inAQ, AudioQueueBuffer inBuffer, int inNumPacketDescs, AudioStreamPacketDescription inPacketDescs, int inTrimFramesAtStart, int inTrimFramesAtEnd, int inNumParamValues, AudioQueueParameterEvent inParamValues, AudioTimeStamp inStartTime, AudioTimeStamp outActualStartTime)
Assigns a buffer to an audio queue for playback, providing parameters and start time information.
You can exert some control of the buffer queue by using this function. You can assign audio queue settings that are in effect carried by an audio queue buffer as you enqueue it. Hence, these changes only take effect when an audio queue buffer begins playing.
This function queues a buffer for playback only, not for recording. Audio queues for recording have no parameters, do not support variable-bit-rate (VBR) formats (which might require trimming), and have a different way to handle timing. When queued for playback, the buffer must contain the audio data to be played back. See AudioQueueEnqueueBuffer for details on queuing a buffer for recording.
If the buffer was allocated with AudioQueueAllocateBufferWithPacketDescriptions, the client should provide packet descriptions in the buffer's mPacketDescriptions and mPacketDescriptionCount fields rather than in inPacketDescs and inNumPacketDescs, which should be NULL and 0, respectively, in this case.
inAQ - The audio queue associated with the buffer.inBuffer - The buffer to be played from.inNumPacketDescs - The number of packet descriptions pointed to by the inPacketDescs parameter. Required
only for variable-bit-rate (VBR) audio formats. Pass 0 if no packet descriptions are
required.inPacketDescs - A pointer to an array of audio stream packet descriptions. Required only for VBR audio
formats. Pass NULL if no packet descriptions are required.inTrimFramesAtStart - The number of priming frames to skip at the start of the buffer.inTrimFramesAtEnd - The number of frames to skip at the end of the buffer.inNumParamValues - The number of parameter values pointed to by the inParamValues parameter.inParamValues - An array of parameter values. (In macOS v10.5, there is only one parameter,
kAudioQueueParam_Volume.) These values are set before buffer playback and cannot be
changed while the buffer is playing. How accurately changes in parameters can be
scheduled depends on the size of the buffer. If there are no parameters to set
(inNumParamValues = 0), pass NULL.inStartTime - A pointer to a structure containing the desired start time for playing the buffer. If
you specify the time using the mSampleTime field of the AudioTimeStamp structure, the
sample time is relative to the time the queue started. If you pass NULL for the start
time, the buffer starts immediately after the previously queued buffer, or as soon as
possible if no buffers are queued ahead of it. Buffers are played in the order they are
queued. If multiple buffers are queued, their times must be in ascending order or NULL;
otherwise, an error occurs. The start time indicates when the actual audio data in the
buffer is to be played (that is, the trim frames are not counted).
Note: When specifying a start time for a buffer, if the buffer is not the first enqueued since AudioQueueStop or AudioQueueReset, it is normally necessary to call AudioQueueFlush before AudioQueueEnqueueBufferWithParameters.
outActualStartTime - On return, points to an AudioTimeStamp structure indicating when the buffer will
actually play.public static int AudioQueueStart(AudioQueueRef inAQ, AudioTimeStamp inStartTime)
Begins playing or recording audio.
If the audio hardware is not already running, this function starts it.
inAQ - The audio queue to start.inStartTime - A pointer to the time at which the audio queue should start. If you specify the time
using the mSampleTime field of the AudioTimeStamp structure, the sample time is
referenced to the sample frame timeline of the associated audio device. May be NULL.public static int AudioQueuePrime(AudioQueueRef inAQ, int inNumberOfFramesToPrepare, org.moe.natj.general.ptr.IntPtr outNumberOfFramesPrepared)
Begins decoding buffers in preparation for playback.
This function begins decoding buffers in preparation for playback. It returns when at least the number of audio sample frames are decoded and ready to play or when all enqueued buffers have been completely decoded. To ensure that a buffer has been decoded and is completely ready for playback, before playback:
1. Call AudioQueueEnqueueBuffer. 2. Call AudioQueuePrime, which waits if you pass 0 to have a default number of frames decoded. 3. Call AudioQueueStart.
Calls to AudioQueuePrime following AudioQueueStart/AudioQueuePrime, and before AudioQueueReset/AudioQueueStop, will have no useful effect. In this situation, outNumberOfFramesPrepared will not have a useful return value.
inAQ - The audio queue to be primed.inNumberOfFramesToPrepare - The number of frames to decode before returning. Pass 0 to decode all enqueued buffers.outNumberOfFramesPrepared - If not NULL, on return, a pointer to the number of frames actually decoded and prepared
for playback.public static int AudioQueueStop(AudioQueueRef inAQ, byte inImmediate)
Stops playing or recording audio.
This function resets the audio queue and stops the audio hardware associated with the queue if it is not in use by other audio services. Synchronous stops occur immediately, regardless of previously buffered audio data. Asynchronous stops occur after all queued buffers have been played or recorded.
inAQ - The audio queue to stop.inImmediate - If you pass true, the stop request occurs immediately (that is, synchronously), and the
function returns when the audio queue has stopped. Buffer callbacks are invoked during
the stopping. If you pass false, the function returns immediately, but the queue does
not stop until all its queued buffers are played or filled (that is, the stop occurs
asynchronously). Buffer callbacks are invoked as necessary until the queue actually
stops. Also, a playback audio queue callback calls this function when there is no more
audio to play.
Note that when stopping immediately, all pending buffer callbacks are normally invoked during the process of stopping. But if the calling thread is responding to a buffer callback, then it is possible for additional buffer callbacks to occur after AudioQueueStop returns.
public static int AudioQueuePause(AudioQueueRef inAQ)
Pauses audio playback or recording.
Pausing the queue does not affect buffers or reset the audio queue. To resume playback or recording using the audio queue, call AudioQueueStart.
inAQ - The queue to be paused.public static int AudioQueueFlush(AudioQueueRef inAQ)
Resets the audio queue's decoder state.
After all queued buffers have been played, the function cleans up all decoder state information. You must call this function following a sequence of buffers of encoded audio; otherwise, some of the audio might not play in the next set of queued buffers. The only time it is not necessary to call AudioQueueFlush is following AudioQueueStop with inImmediate=false. (This action internally calls AudioQueueFlush.)
Also, you might wish to call this function before calling AudioQueueStop depending on whether you want to stop immediately regardless of what has played or whether you want to ensure that all buffered data and all data that is in the middle of processing gets recorded or played before stopping.
inAQ - The audio queue to be flushed.public static int AudioQueueReset(AudioQueueRef inAQ)
Resets an audio queue.
This function immediately resets an audio queue, flushes any queued buffer, removes all buffers from previously scheduled use, and resets any decoder and digital signal processing (DSP) state information. It also invokes callbacks for any flushed buffers. If you queue any buffers after calling this function, processing does not occur until the decoder and DSP state information is reset. Hence, a discontinuity (that is, a "glitch") might occur.
Note that when resetting, all pending buffer callbacks are normally invoked during the process of resetting. But if the calling thread is responding to a buffer callback, then it is possible for additional buffer callbacks to occur after AudioQueueReset returns.
inAQ - The audio queue to reset.public static int AudioQueueGetParameter(AudioQueueRef inAQ, int inParamID, org.moe.natj.general.ptr.FloatPtr outValue)
Obtains an audio queue parameter value.
You can access the current parameter values for an audio queue at any time with this function.
inAQ - The audio queue whose parameter value you want to obtain.inParamID - The ID of the parameter you want to obtain. In macOS v10.5, audio queues have one
parameter available: kAudioQueueParam_Volume, which controls the queue's playback
volume.outValue - On return, points to the current value of the specified parameter.public static int AudioQueueSetParameter(AudioQueueRef inAQ, int inParamID, float inValue)
Sets an audio queue parameter value.
inAQ - The audio queue whose parameter value you want to set.inParamID - The ID of the parameter you want to set.inValue - The parameter value to set.public static int AudioQueueGetProperty(AudioQueueRef inAQ, int inID, org.moe.natj.general.ptr.VoidPtr outData, org.moe.natj.general.ptr.IntPtr ioDataSize)
Obtains an audio queue property value.
inAQ - The audio queue whose property value you want to obtain.inID - The ID of the property you want to obtain. See "Audio Queue Property IDs."outData - On return, points to the desired property value.ioDataSize - A pointer to the size of the property data. On input, points to the maximum bytes of
space the caller expects to receive. On return, points to the actual data size.public static int AudioQueueSetProperty(AudioQueueRef inAQ, int inID, org.moe.natj.general.ptr.ConstVoidPtr inData, int inDataSize)
Sets an audio queue property value.
inAQ - The audio queue whose property value you want to set.inID - The ID of the property you want to set. See "Audio Queue Property IDs" for the various
audio queue properties.inData - A pointer to the property value to set.inDataSize - The size of the property data.public static int AudioQueueGetPropertySize(AudioQueueRef inAQ, int inID, org.moe.natj.general.ptr.IntPtr outDataSize)
Obtains the size of an audio queue property.
inAQ - The audio queue containing the property value whose size you want to obtain.inID - The ID of the property value whose size you want to obtain. See "Audio Queue Property
IDs" for possible values.outDataSize - On return, points to the size of the specified property value.public static int AudioQueueAddPropertyListener(AudioQueueRef inAQ, int inID, AudioToolbox.Function_AudioQueueAddPropertyListener inProc, org.moe.natj.general.ptr.VoidPtr inUserData)
Adds a listener callback for a property.
This callback is used to act upon a change in an audio queue property such as kAudioQueueProperty_IsRunning. For instance, if your application has a user interface with a Play/Stop button, and kAudioQueueProperty_IsRunning changes, you need to update your button.
inAQ - The audio queue that owns the property you want to assign the listener callback to.inID - The ID of the property to which you want to assign a listener callback. See "Audio Queue Property IDs".inProc - The listener callback to be called when the property value changes.inUserData - A value to be passed to the listener callback when it is called.public static int AudioQueueRemovePropertyListener(AudioQueueRef inAQ, int inID, AudioToolbox.Function_AudioQueueRemovePropertyListener inProc, org.moe.natj.general.ptr.VoidPtr inUserData)
Removes a listener callback for a property.
inAQ - The audio queue that owns the property from which you want to remove a listener.inID - The ID of the property from which you want to remove a listener.inProc - The listener being removed.inUserData - The same inUserData value that was previously passed to AudioQueueAddPropertyListener.public static int AudioQueueCreateTimeline(AudioQueueRef inAQ, org.moe.natj.general.ptr.Ptr<AudioQueueTimelineRef> outTimeline)
Creates a timeline object.
You need to instantiate a timeline object if you want to know about any timeline discontinuities. See AudioQueueGetCurrentTime for more details.
inAQ - The audio queue to associate with the new timeline object.outTimeline - On return, points to the newly created timeline object.public static int AudioQueueDisposeTimeline(AudioQueueRef inAQ, AudioQueueTimelineRef inTimeline)
Disposes of a timeline object.
Disposing of an audio queue automatically disposes of any associated timeline objects. Call this function only if you want to dispose of a timeline object and not the audio queue associated with it.
inAQ - The audio queue associated with the timeline object you want to dispose of.inTimeline - The timeline object to dispose of.public static int AudioQueueGetCurrentTime(AudioQueueRef inAQ, AudioQueueTimelineRef inTimeline, AudioTimeStamp outTimeStamp, org.moe.natj.general.ptr.BytePtr outTimelineDiscontinuity)
Obtains the current audio queue time.
You must specify a timeline object if you want to be notified about any timeline discontinuities in the outTimelineDiscontinuity parameter. If you don't care about discontinuities, pass NULL in the inTimeLine and outTimelineDiscontinuity parameters.
inAQ - The audio queue whose current time you want to obtain.inTimeline - The audio queue timeline object to which any timeline discontinuities are reported. May
be NULL.outTimeStamp - On return, points to an audio timestamp structure containing the current audio queue
time. The mSampleTime field is in terms of the audio queue's sample rate, and relative
to the time at which the queue has started or will start.outTimelineDiscontinuity - Can be NULL. On return, only set to true or false if the inTimeLine parameter is not
NULL. Set to true if a discontinuity has occurred in the sample timeline of the audio
queue. For instance, the device's sample rate changed and a gap occurred in playback or
recording, or the audio queue was unable to prepare and playback in time because it was
late.public static int AudioQueueDeviceGetCurrentTime(AudioQueueRef inAQ, AudioTimeStamp outTimeStamp)
Obtains the current time of the audio device associated with an audio queue.
If the audio device associated with the audio queue is not running, the only valid field in the audio timestamp structure is mHostTime. This result differentiates the action of this function from that of the AudioDeviceGetCurrentTime function, (declared in AudioHardware.h) which returns an error if the audio device is not running.
inAQ - The audio queue whose audio device is to be queried.outTimeStamp - A pointer to a structure that, on return, contains the current time of the audio device
associated with the audio queue.public static int AudioQueueDeviceTranslateTime(AudioQueueRef inAQ, AudioTimeStamp inTime, AudioTimeStamp outTime)
Converts the time in the time base of the associated audio device from one representation to another.
This function converts from one time representation to another (for example, from sample time to host time or vice versa):
- Sample time is the absolute sample frame time. Sample numbers are the count of the samples on the audio device. - Host time is the time base of the host machine such as the time of the bus clock on the CPU.
The mSampleTime field in the AudioTimestamp structure (described in Core Audio Data Types Reference) is always in device time, not in audio queue time. Audio queue time is relative to the audio queue's start time. The associated audio device has to be running for the AudioQueueDeviceTranslateTime function to provide a result.
inAQ - The queue whose audio device is to perform the requested time translation.inTime - A pointer to a structure containing the time to be translated.outTime - A pointer to the the translated time.public static int AudioQueueDeviceGetNearestStartTime(AudioQueueRef inAQ, AudioTimeStamp ioRequestedStartTime, int inFlags)
Obtains an audio device's start time that is closest to a requested start time.
inAQ - The audio queue whose device's nearest start time you want to obtain.ioRequestedStartTime - On entry, points to the requested start time. On return, points to the actual start time.inFlags - Reserved for future use. Pass 0.public static int AudioQueueSetOfflineRenderFormat(AudioQueueRef inAQ, AudioStreamBasicDescription inFormat, AudioChannelLayout inLayout)
Specify an audio format to which the queue will perform subsequent offline rendering, or disable offline rendering.
An output queue's audio playback can be redirected for capture to an audio file, to support an export function, for example. AudioQueueSetOfflineRenderFormat switches a queue between normal and offline rendering modes.
inAQ - The output queue whose offline rendering mode is to be changed.inFormat - The desired format for offline rendering. Pass NULL to disable offline rendering and return the
queue to normal output to an audio device. This format must be linear PCM and (if not mono)
interleaved.inLayout - The desired channel layout for offline rendering; also NULL when disabling offline rendering.public static int AudioQueueOfflineRender(AudioQueueRef inAQ, AudioTimeStamp inTimestamp, AudioQueueBuffer ioBuffer, int inNumberFrames)
Obtain a buffer of audio output from a queue in offline rendering mode.
inAQ - The output queue from which to obtain output.inTimestamp - The point in time corresponding to the beginning of the output buffer. Only mSampleTime
is used. mFlags must include kAudioTimeStampSampleTimeValid.ioBuffer - The buffer into which the queue will render.inNumberFrames - The number of frames of audio to render. Note that fewer frames than requested may be returned.
This can happen if insufficient data was enqueued.public static int AudioQueueProcessingTapNew(AudioQueueRef inAQ, AudioToolbox.Function_AudioQueueProcessingTapNew inCallback, org.moe.natj.general.ptr.VoidPtr inClientData, int inFlags, org.moe.natj.general.ptr.IntPtr outMaxFrames, AudioStreamBasicDescription outProcessingFormat, org.moe.natj.general.ptr.Ptr<AudioQueueProcessingTapRef> outAQTap)
Create a new processing tap
This function creates a processing tap on a given audio queue. A processing tap can only be established (or removed) on an audio queue that is stopped (paused is not sufficient). The processing tap will then be used to process either decoded data in the case of an output queue, or input data (before it is encoded) in the case of an input queue.
The processing is performed on audio either before or after any effects or other processing (varispeed, etc) is applied by the audio queue, depending on inFlags.
inAQ - The audio queue from which to create the processing tapinCallback - A callback which the queue will call to process the audioinClientData - Client data provided to the callbackinFlags - Flags that are used to control aspects of the processing tap.
Valid flags are:
- kAudioQueueProcessingTap_PreEffects: processing is done before any
further effects are applied by the audio queue to the audio
- kAudioQueueProcessingTap_PostEffects: processing is done after all
processing is done, including that of other taps.
- kAudioQueueProcessingTap_SiphonoutMaxFrames - The maximum number of sample frames that can be requested of a processing
tap at any one time. Typically this will be approximately 50 msec of audio
(2048 samples @ 44.1kHz)outProcessingFormat - The format in which the client will receive the audio data to be processed.
This will always be the same sample rate as the client format and usually
the same number of channels as the client format of the audio queue. (NOTE:
the number of channels may be different in some cases if the client format
has some channel count restrictions, for instance the client provides 5.1
AAC, but the decoder can only produce stereo). The channel order, if the
same as the client format, will be the same as the client channel order. If
the channel count is changed, it will be to either 1 (mono) or 2 (stereo, in
which case the first channel is left, the second right).
If the data is not in a convenient format for the client to process in, then the client should convert the data to and from that format. This is the most efficient mechanism to use (as the audio queue can chose a format that is most efficient from its playback (or recording) requirement.
outAQTap - The processing tap object.public static int AudioQueueProcessingTapDispose(AudioQueueProcessingTapRef inAQTap)
Dispose a processing tap object
As with AudioQueueProcessingTapNew(), this call can only be made on an audio queue that is stopped (paused is not sufficient)
inAQTap - The processing tap to dispose.public static int AudioQueueProcessingTapGetSourceAudio(AudioQueueProcessingTapRef inAQTap, int inNumberFrames, AudioTimeStamp ioTimeStamp, org.moe.natj.general.ptr.IntPtr outFlags, org.moe.natj.general.ptr.IntPtr outNumberFrames, AudioBufferList ioData)
Used by a processing tap to retrieve source audio.
This function may only be called from the processing tap's callback.
inAQTap - the processing tapinNumberFrames - the number of frames the processing tap requires for its processingioTimeStamp - On an input audio queue, the timestamp is returned from this function.
On an output audio queue, the caller must provide a continuous timestamp.outFlags - flags to describe state about the input requested, e.g.
discontinuity/completeoutNumberFrames - the number of source frames that have been provided by the parent audio
queue. This can be less than the number of requested frames specified in
inNumberFramesioData - the audio buffer list which will contain the source data. The audio queue owns
the buffer pointers if NULL pointers were provided (recommended). In this case
the source buffers are only valid for the duration of the processing tap
callback. If the buffer pointers are non-NULL, then they must be big enough to
hold inNumberFrames, and the audio queue will copy its source data into those
buffers.public static int AudioQueueProcessingTapGetQueueTime(AudioQueueProcessingTapRef inAQTap, org.moe.natj.general.ptr.DoublePtr outQueueSampleTime, org.moe.natj.general.ptr.IntPtr outQueueFrameCount)
Used by a processing tap to retrieve the queue's current time.
This function may only be called from the processing tap's callback, and only for audio output queues. It must be called after calling AudioQueueProcessingTapGetSourceAudio().
inAQTap - the processing tapoutQueueSampleTime - the current sample time of the audio queue. This will appear to be stationary
if the queue is paused.outQueueFrameCount - the number of sample frames of queue time corresponding to the current chunk of
audio being processed by the tap. This will differ from the frame count passed
to the tap if the queue's playback rate is currently other than 1.0, due to the
use of time compression/expansion. The frame count can also be 0 if the queue is
paused.@Deprecated public static int AudioSessionInitialize(CFRunLoopRef inRunLoop, CFStringRef inRunLoopMode, AudioToolbox.Function_AudioSessionInitialize inInterruptionListener, org.moe.natj.general.ptr.VoidPtr inClientData)
Initialize the AudioSession.
This function has to be called once before calling any other AudioSession functions.
inRunLoop - A CFRunLoopRef indicating the desired run loop the interruption routine should
be run on. Pass NULL to use the main run loop.inRunLoopMode - A CFStringRef indicating the run loop mode for the runloop where the
completion routine will be executed. Pass NULL to use kCFRunLoopDefaultMode.inInterruptionListener - An AudioSessionInterruptionListener to be called when the AudioSession
is interrupted.inClientData - The client user data to use when calling the interruption listener.@Deprecated public static int AudioSessionSetActive(byte active)
Activate or deactivate the AudioSession.
Call this function with active set to true to activate this AudioSession (interrupt the currently active AudioSession). Call this function with active set to false to deactivate this AudioSession (allow another interrupted AudioSession to resume). When active is true this call may fail if the currently active AudioSession has a higher priority.
active - A Boolean indicating if you want to make this AudioSession active or inactive.@Deprecated
public static int AudioSessionSetActiveWithFlags(byte active,
int inFlags)
Same functionality as AudioSessionSetActive, with an additional flags parameter for refining behavior.
Call this function with active set to true to activate this AudioSession (interrupt the currently active AudioSession). Call this function with active set to false to deactivate this AudioSession (allow another interrupted AudioSession to resume). Pass in one or more flags to refine the behavior during activation or deactivation. When active is true this call may fail if the currently active AudioSession has a higher priority.
active - A Boolean indicating if you want to make this AudioSession active or inactive.inFlags - A bitmap containing one or more flags from the AudioSessionActivationFlags enum.@Deprecated
public static int AudioSessionGetProperty(int inID,
org.moe.natj.general.ptr.IntPtr ioDataSize,
org.moe.natj.general.ptr.VoidPtr outData)
Get the value of a property.
This function can be called to get the value for a property of the AudioSession. Valid properties are listed in an enum above.
inID - The AudioSessionPropertyID for which we want to get the value.ioDataSize - The size of the data payload.
On entry it should contain the size of the memory pointed to by outData.
On exit it will contain the actual size of the data.outData - The data for the property will be copied here.@Deprecated
public static int AudioSessionSetProperty(int inID,
int inDataSize,
org.moe.natj.general.ptr.ConstVoidPtr inData)
Set the value of a property.
This function can be called to set the value for a property of the AudioSession. Valid properties are listed in an enum above.
inID - The AudioSessionPropertyID for which we want to set the value.inDataSize - The size of the data payload.inData - The data for the property we want to set.@Deprecated
public static int AudioSessionGetPropertySize(int inID,
org.moe.natj.general.ptr.IntPtr outDataSize)
Get the size of the payload for a property.
This function can be called to get the size for the payload of a property. Valid properties are listed in an enum above.
inID - The AudioSessionPropertyID for which we want to get the size of the payload.outDataSize - The size of the data payload will be copied here.@Deprecated
public static int AudioSessionAddPropertyListener(int inID,
AudioToolbox.Function_AudioSessionAddPropertyListener inProc,
org.moe.natj.general.ptr.VoidPtr inClientData)
Add a property listener.
This function can be used to add a listener to be called when a property changes. If a listener and user data already exist for this property, they will be replaced. Valid properties are listed above.
inID - The AudioSessionPropertyID for which we want to set a listener.inProc - The listener to be called when the property changes.inClientData - The client user data to use when calling the listener.@Deprecated public static int AudioSessionRemovePropertyListener(int inID)
see AudioSessionRemovePropertyListenerWithUserData
see AudioSessionRemovePropertyListenerWithUserData
@Deprecated
public static int AudioSessionRemovePropertyListenerWithUserData(int inID,
AudioToolbox.Function_AudioSessionRemovePropertyListenerWithUserData inProc,
org.moe.natj.general.ptr.VoidPtr inClientData)
Remove a property listener.
This function can be called to remove the listener for a property. The caller provides the same proc and user data that was used to add the listener. This ensures that there can be more than one listener established for a given property ID, and each listener can be removed as requested. Valid properties are listed above.
inID - The AudioSessionPropertyID for which we want to remove the listener.inProc - The proc that was used to add the listener that needs to be removed.inClientData - The client data that was used to add the listener that needs to be removed.public static int AudioServicesCreateSystemSoundID(CFURLRef inFileURL, org.moe.natj.general.ptr.IntPtr outSystemSoundID)
Allows the application to designate an audio file for playback by the System Sound server.
Returned SystemSoundIDs are passed to AudioServicesPlayAlertSoundWithCompletion() and AudioServicesPlaySystemSoundWithCompletion() to be played.
The maximum supported duration for a system sound is 30 secs.
inFileURL - A CFURLRef for an AudioFile.outSystemSoundID - Returns a SystemSoundID.public static int AudioServicesDisposeSystemSoundID(int inSystemSoundID)
Allows the System Sound server to dispose any resources needed for the provided SystemSoundID.
Allows the application to tell the System Sound server that the resources for the associated audio file are no longer required.
inSystemSoundID - A SystemSoundID that the application no longer needs to use.public static void AudioServicesPlayAlertSoundWithCompletion(int inSystemSoundID,
AudioToolbox.Block_AudioServicesPlayAlertSoundWithCompletion inCompletionBlock)
Play an alert sound
Play the sound designated by the provided SystemSoundID with alert sound behavior.
inSystemSoundID - The SystemSoundID to be played. On the desktop the kSystemSoundID_UserPreferredAlert
constant can be passed in to play back the alert sound selected by the user
in System Preferences. On iOS there is no preferred user alert sound.inCompletionBlock - The completion block gets executed for every attempt to play a system sound irrespective
of success or failure. The callbacks are issued on a serial queue and the client is
responsible for handling thread safety.public static void AudioServicesPlaySystemSoundWithCompletion(int inSystemSoundID,
AudioToolbox.Block_AudioServicesPlaySystemSoundWithCompletion inCompletionBlock)
Play a system sound
Play the sound designated by the provided SystemSoundID.
inSystemSoundID - The SystemSoundID to be played.inCompletionBlock - The completion block gets executed for every attempt to play a system sound irrespective
of success or failure. The callbacks are issued on a serial queue and the client is
responsible for handling thread safety.public static int AudioServicesGetPropertyInfo(int inPropertyID,
int inSpecifierSize,
org.moe.natj.general.ptr.ConstVoidPtr inSpecifier,
org.moe.natj.general.ptr.IntPtr outPropertyDataSize,
org.moe.natj.general.ptr.BytePtr outWritable)
Get information about the size of an AudioServices property and whether it can be set.
inPropertyID - a AudioServicesPropertyID constant.inSpecifierSize - The size of the specifier data.inSpecifier - A specifier is a buffer of data used as an input argument to some of the
properties.outPropertyDataSize - The size in bytes of the current value of the property. In order to get the
property value, you will need a buffer of this size.outWritable - Will be set to 1 if writable, or 0 if read only.public static int AudioServicesGetProperty(int inPropertyID,
int inSpecifierSize,
org.moe.natj.general.ptr.ConstVoidPtr inSpecifier,
org.moe.natj.general.ptr.IntPtr ioPropertyDataSize,
org.moe.natj.general.ptr.VoidPtr outPropertyData)
Retrieve the indicated property data
inPropertyID - a AudioServicesPropertyID constant.inSpecifierSize - The size of the specifier data.inSpecifier - A specifier is a buffer of data used as an input argument to some of the
properties.ioPropertyDataSize - On input, the size of the outPropertyData buffer. On output the number of
bytes written to the buffer.outPropertyData - The buffer in which to write the property data. May be NULL if caller only
wants ioPropertyDataSize to be filled with the amount that would have been
written.public static int AudioServicesSetProperty(int inPropertyID,
int inSpecifierSize,
org.moe.natj.general.ptr.ConstVoidPtr inSpecifier,
int inPropertyDataSize,
org.moe.natj.general.ptr.ConstVoidPtr inPropertyData)
Set the indicated property data
inPropertyID - a AudioServicesPropertyID constant.inSpecifierSize - The size of the specifier data.inSpecifier - A specifier is a buffer of data used as an input argument to some of the
properties.inPropertyDataSize - The size of the inPropertyData buffer.inPropertyData - The buffer containing the property data.public static void AudioServicesPlayAlertSound(int inSystemSoundID)
[@function] AudioServicesPlayAlertSound
Play an Alert Sound
Play the provided SystemSoundID with AlertSound behavior.
inSystemSoundID - A SystemSoundID for the System Sound server to play. On the desktop you
can pass the kSystemSoundID_UserPreferredAlert constant to playback the alert sound
selected by the user in System Preferences. On iOS there is no preferred user alert sound.public static void AudioServicesPlaySystemSound(int inSystemSoundID)
[@function] AudioServicesPlaySystemSound
Play the sound designated by the provided SystemSoundID.
A SystemSoundID indicating the desired System Sound to be played.
inSystemSoundID - A SystemSoundID for the System Sound server to play.public static int AudioServicesAddSystemSoundCompletion(int inSystemSoundID,
CFRunLoopRef inRunLoop,
CFStringRef inRunLoopMode,
AudioToolbox.Function_AudioServicesAddSystemSoundCompletion inCompletionRoutine,
org.moe.natj.general.ptr.VoidPtr inClientData)
[@function] AudioServicesAddSystemSoundCompletion
Call the provided Completion Routine when provided SystemSoundID finishes playing.
Once set, the System Sound server will send a message to the System Sound client indicating which SystemSoundID has finished playing.
inSystemSoundID - The SystemSoundID to associate with the provided completion
routine.inRunLoop - A CFRunLoopRef indicating the desired run loop the completion routine should
be run on. Pass NULL to use the main run loop.inRunLoopMode - A CFStringRef indicating the run loop mode for the runloop where the
completion routine will be executed. Pass NULL to use kCFRunLoopDefaultMode.inCompletionRoutine - An AudioServicesSystemSoundCompletionProc to be called when the provided
SystemSoundID has completed playing in the server.inClientData - A void* to pass client data to the completion routine.public static void AudioServicesRemoveSystemSoundCompletion(int inSystemSoundID)
[@function] AudioServicesRemoveSystemSoundCompletion
Disassociate any completion proc for the specified SystemSoundID
Tells the SystemSound client to remove any completion proc associated with the provided SystemSoundID
inSystemSoundID - The SystemSoundID for which completion routines should be
removed.public static int ExtAudioFileOpenURL(CFURLRef inURL, org.moe.natj.general.ptr.Ptr<ExtAudioFileRef> outExtAudioFile)
Opens an audio file specified by a CFURLRef.
Allocates a new ExtAudioFileRef, for reading an existing audio file.
inURL - The audio file to read.outExtAudioFile - On exit, a newly-allocated ExtAudioFileRef.public static int ExtAudioFileWrapAudioFileID(AudioFileID inFileID, byte inForWriting, org.moe.natj.general.ptr.Ptr<ExtAudioFileRef> outExtAudioFile)
Wrap an AudioFileID in an ExtAudioFileRef.
Allocates a new ExtAudioFileRef which wraps an existing AudioFileID. The client is responsible for keeping the AudioFileID open until the ExtAudioFileRef is disposed. Disposing the ExtAudioFileRef will not close the AudioFileID when this Wrap API call is used, so the client is also responsible for closing the AudioFileID when finished with it.
inFileID - The AudioFileID to wrap.inForWriting - True if the AudioFileID is a new file opened for writing.outExtAudioFile - On exit, a newly-allocated ExtAudioFileRef.public static int ExtAudioFileCreateWithURL(CFURLRef inURL, int inFileType, AudioStreamBasicDescription inStreamDesc, AudioChannelLayout inChannelLayout, int inFlags, org.moe.natj.general.ptr.Ptr<ExtAudioFileRef> outExtAudioFile)
Create a new audio file.
Creates a new audio file.
If the file to be created is in an encoded format, it is permissible for the sample rate in inStreamDesc to be 0, since in all cases, the file's encoding AudioConverter may produce audio at a different sample rate than the source. The file will be created with the audio format actually produced by the encoder.
inURL - The URL of the new audio file.inFileType - The type of file to create. This is a constant from AudioToolbox/AudioFile.h, e.g.
kAudioFileAIFFType. Note that this is not an HFSTypeCode.inStreamDesc - The format of the audio data to be written to the file.inChannelLayout - The channel layout of the audio data. If non-null, this must be consistent
with the number of channels specified by inStreamDesc.inFlags - The same flags as are used with AudioFileCreateWithURL
Can use these to control whether an existing file is overwritten (or not).outExtAudioFile - On exit, a newly-allocated ExtAudioFileRef.public static int ExtAudioFileDispose(ExtAudioFileRef inExtAudioFile)
Close the file and dispose the object.
Closes the file and deletes the object.
inExtAudioFile - The extended audio file object.public static int ExtAudioFileRead(ExtAudioFileRef inExtAudioFile, org.moe.natj.general.ptr.IntPtr ioNumberFrames, AudioBufferList ioData)
Perform a synchronous sequential read.
If the file has a client data format, then the audio data from the file is translated from the file data format to the client format, via the ExtAudioFile's internal AudioConverter.
(Note that the use of sequential reads/writes means that an ExtAudioFile must not be read on multiple threads; clients wishing to do this should use the lower-level AudioFile API set).
inExtAudioFile - The extended audio file object.ioNumberFrames - On entry, ioNumberFrames is the number of frames to be read from the file.
On exit, it is the number of frames actually read. A number of factors may
cause a fewer number of frames to be read, including the supplied buffers
not being large enough, and internal optimizations. If 0 frames are
returned, however, this indicates that end-of-file was reached.ioData - Buffer(s) into which the audio data is read.public static int ExtAudioFileWrite(ExtAudioFileRef inExtAudioFile, int inNumberFrames, AudioBufferList ioData)
Perform a synchronous sequential write.
If the file has a client data format, then the audio data in ioData is translated from the client format to the file data format, via the ExtAudioFile's internal AudioConverter.
inExtAudioFile - The extended audio file object.inNumberFrames - The number of frames to write.ioData - The buffer(s) from which audio data is written to the file.public static int ExtAudioFileWriteAsync(ExtAudioFileRef inExtAudioFile, int inNumberFrames, AudioBufferList ioData)
Perform an asynchronous sequential write.
Writes the provided buffer list to an internal ring buffer and notifies an internal thread to perform the write at a later time. The first time this is called, allocations may be performed. You can call this with 0 frames and null buffer in a non-time-critical context to initialize the asynchronous mechanism. Once initialized, subsequent calls are very efficient and do not take locks; thus this may be used to write to a file from a realtime thread.
The client must not mix synchronous and asynchronous writes to the same file.
Pending writes are not guaranteed to be flushed to disk until ExtAudioFileDispose is called.
N.B. Errors may occur after this call has returned. Such errors may be returned from subsequent calls to this function.
inExtAudioFile - The extended audio file object.inNumberFrames - The number of frames to write.ioData - The buffer(s) from which audio data is written to the file.public static int ExtAudioFileSeek(ExtAudioFileRef inExtAudioFile, long inFrameOffset)
Seek to a specific frame position.
Sets the file's read position to the specified sample frame number. The next call to ExtAudioFileRead will return samples from precisely this location, even if it is located in the middle of a packet.
This function's behavior with files open for writing is currently undefined.
inExtAudioFile - The extended audio file object.inFrameOffset - The desired seek position, in sample frames, relative to the beginning of
the file. This is specified in the sample rate and frame count of the file's format
(not the client format)public static int ExtAudioFileTell(ExtAudioFileRef inExtAudioFile, org.moe.natj.general.ptr.LongPtr outFrameOffset)
Return the file's read/write position.
inExtAudioFile - The extended audio file object.outFrameOffset - On exit, the file's current read/write position in sample frames. This is specified in the
sample rate and frame count of the file's format (not the client format)public static int ExtAudioFileGetPropertyInfo(ExtAudioFileRef inExtAudioFile, int inPropertyID, org.moe.natj.general.ptr.IntPtr outSize, org.moe.natj.general.ptr.BytePtr outWritable)
Get information about a property
inExtAudioFile - The extended audio file object.inPropertyID - The property being queried.outSize - If non-null, on exit, this is set to the size of the property's value.outWritable - If non-null, on exit, this indicates whether the property value is settable.public static int ExtAudioFileGetProperty(ExtAudioFileRef inExtAudioFile, int inPropertyID, org.moe.natj.general.ptr.IntPtr ioPropertyDataSize, org.moe.natj.general.ptr.VoidPtr outPropertyData)
Get a property value.
inExtAudioFile - The extended audio file object.inPropertyID - The property being fetched.ioPropertyDataSize - On entry, the size (in bytes) of the memory pointed to by outPropertyData.
On exit, the actual size of the property data returned.outPropertyData - The value of the property is copied to the memory this points to.public static int ExtAudioFileSetProperty(ExtAudioFileRef inExtAudioFile, int inPropertyID, int inPropertyDataSize, org.moe.natj.general.ptr.ConstVoidPtr inPropertyData)
Set a property value.
inExtAudioFile - The extended audio file object.inPropertyID - The property being set.inPropertyDataSize - The size of the property data, in bytes.inPropertyData - Points to the property's new value.public static int NewMusicPlayer(org.moe.natj.general.ptr.Ptr<MusicPlayer> outPlayer)
Create a new music player
A music player is used to play a sequence back. This call is used to create a player When a sequence is to be played by a player, it can play to either an AUGraph, a MIDI Destination or a mixture/combination of both.
outPlayer - the newly created playerpublic static int DisposeMusicPlayer(MusicPlayer inPlayer)
Dispose a music player
inPlayer - the player to disposepublic static int MusicPlayerSetSequence(MusicPlayer inPlayer, MusicSequence inSequence)
Set the sequence for the player to play
A Sequence cannot be set on a player while it is playing. Setting a sequence will overide the currently set sequence.
inPlayer - the playerinSequence - the sequence for the player to playpublic static int MusicPlayerGetSequence(MusicPlayer inPlayer, org.moe.natj.general.ptr.Ptr<MusicSequence> outSequence)
Get the sequence attached to a player
If the player does not have a sequence set, this will return the _NoSequence error
inPlayer - the playeroutSequence - the sequence currently set on the playerpublic static int MusicPlayerSetTime(MusicPlayer inPlayer, double inTime)
Set the current time on the player
The Get and Set Time calls take a specification of time as beats. This positions the player to the specified time based on the currently set sequence. No range checking on the time value is done. This can be set on a playing player (in which case playing will be resumed from the new time).
inPlayer - the playerinTime - the new time valuepublic static int MusicPlayerGetTime(MusicPlayer inPlayer, org.moe.natj.general.ptr.DoublePtr outTime)
Get the current time of the player
The Get and Set Time calls take a specification of time as beats. This retrieves the player's current time. If it is playing this time is the time of the player at the time the call was made.
inPlayer - the playeroutTime - the current time valuepublic static int MusicPlayerGetHostTimeForBeats(MusicPlayer inPlayer, double inBeats, org.moe.natj.general.ptr.LongPtr outHostTime)
Returns the host time that will be (or was) played at the specified beat.
This call is only valid if the player is playing and will return an error if the player is not playing or if the starting position of the player (its "starting beat") was after the specified beat. For general translation of beats to time in a sequence, see the MusicSequence calls for beat<->seconds.
The call uses the player's sequence's tempo map to translate a beat time from the starting time and beat of the player.
inPlayer - the playerinBeats - the specified beat-time valueoutHostTime - the corresponding host timepublic static int MusicPlayerGetBeatsForHostTime(MusicPlayer inPlayer, long inHostTime, org.moe.natj.general.ptr.DoublePtr outBeats)
Returns the beat that will be (or was) played at the specified host time.
This call is only valid if the player is playing and will return an error if the player is not playing or if the starting time of the player was after the specified host time. For general translation of beats to time in a sequence, see the MusicSequence calls for beat<->seconds.
The call uses the player's sequence's tempo map to retrieve a beat time from the starting and specified host time.
inPlayer - the playerinHostTime - the specified host time valueoutBeats - the corresponding beat timepublic static int MusicPlayerPreroll(MusicPlayer inPlayer)
Prepare the player for playing
Allows the player to prepare its state so that starting is has a lower latency. If a player is started without being prerolled, the player will pre-roll itself and then start.
inPlayer - the playerpublic static int MusicPlayerStart(MusicPlayer inPlayer)
Start the player
If the player has not been prerolled, it will pre-roll itself and then start.
inPlayer - the playerpublic static int MusicPlayerStop(MusicPlayer inPlayer)
Stop the player
inPlayer - the playerpublic static int MusicPlayerIsPlaying(MusicPlayer inPlayer, org.moe.natj.general.ptr.BytePtr outIsPlaying)
Returns the playing state of the player. "Is it playing?"
This call returns a non-zero value in outIsPlaying if the player has been started and not stopped. It may have "played" past the events of the attached MusicSequence, but it is still considered to be playing (and its time value increasing) until it is explicitly stopped
inPlayer - the playeroutIsPlaying - false if not, true (non-zero) if is playingpublic static int MusicPlayerSetPlayRateScalar(MusicPlayer inPlayer, double inScaleRate)
Scale the playback rate of the player
inPlayer - the playerinScaleRate - a scalar that will be applied to the playback rate. If 2, playback is twice as fast, if
0.5 it is half as fast. As a scalar, the value must be greater than zero.public static int MusicPlayerGetPlayRateScalar(MusicPlayer inPlayer, org.moe.natj.general.ptr.DoublePtr outScaleRate)
Get the playback rate scalar of the player
inPlayer - the playeroutScaleRate - the current scalar being applied to the player. Default value is 1.0public static int NewMusicSequence(org.moe.natj.general.ptr.Ptr<MusicSequence> outSequence)
Create a new empty sequence
A new music sequence will only have a tempo track (with a default tempo of 120 bpm), and the default type is beat based.
When a sequence is to be played by a player, it can play to either an AUGraph, a MIDI Destination or a mixture/combination of both. See MusicSequenceSetAUGraph and MusicSequenceSetMIDIEndpoint for the generic destination assignments. Specific tracks can also be assigned nodes of a graph or a MIDI endpoint as targets for the events that they contain; see MusicTrackSetDestNode and MusicTrackSetDestMIDIEndpoint.
outSequence - the new sequencepublic static int DisposeMusicSequence(MusicSequence inSequence)
Dispose the sequence
A sequence cannot be disposed while a MusicPlayer has it.
inSequence - the sequencepublic static int MusicSequenceNewTrack(MusicSequence inSequence, org.moe.natj.general.ptr.Ptr<MusicTrack> outTrack)
Add a new (empty) track to the sequence
inSequence - the sequenceoutTrack - the new track (it is always appended to any existing tracks)public static int MusicSequenceDisposeTrack(MusicSequence inSequence, MusicTrack inTrack)
Remove and dispose a track from a sequence
inSequence - the sequenceinTrack - the track to remove and disposepublic static int MusicSequenceGetTrackCount(MusicSequence inSequence, org.moe.natj.general.ptr.IntPtr outNumberOfTracks)
The number of tracks in a sequence. The track count and accessors exclude the tempo track (which is treated as a special case)
inSequence - the sequenceoutNumberOfTracks - the number of trackspublic static int MusicSequenceGetIndTrack(MusicSequence inSequence, int inTrackIndex, org.moe.natj.general.ptr.Ptr<MusicTrack> outTrack)
Get a track at the specified index
Index is zero based. It will return kAudio_ParamError if index is not in the range: 0 < TrackCount The track count and accessors exclude the tempo track (which is treated as a special case)
inSequence - the sequenceinTrackIndex - the indexoutTrack - the track at that indexpublic static int MusicSequenceGetTrackIndex(MusicSequence inSequence, MusicTrack inTrack, org.moe.natj.general.ptr.IntPtr outTrackIndex)
Get the index for a specific track
Index is zero based. It will return an error if the track is not a member of the sequence. The track count and accessors exclude the tempo track (which is treated as a special case)
inSequence - the sequenceinTrack - the trackoutTrackIndex - the index of the trackpublic static int MusicSequenceGetTempoTrack(MusicSequence inSequence, org.moe.natj.general.ptr.Ptr<MusicTrack> outTrack)
Get the tempo track of the sequence
Each sequence has a single tempo track. All tempo events are placed into this tempo track (as well as other appropriate events (time sig for instance from a MIDI file). The tempo track, once retrieved can be edited and iterated upon as any other track. Non-tempo events in a tempo track are ignored.
inSequence - the sequenceoutTrack - the tempo track of the sequencepublic static int MusicSequenceSetAUGraph(MusicSequence inSequence, AUGraph inGraph)
Set the graph to be associated with the sequence
A sequence can be associated with an AUGraph and this graph will be used to render the events as controlled by the sequence when it is played. By default, all of the tracks of a sequence will find the first AUNode that is an instance of an Apple MusicDevice audio unit (see MusicSequenceGetAUGraph). Specific nodes of the graph can be targeted for different tracks (see MusicTrackSetDestNode). To render a multi-track GM MIDI sequence on iOS, create a custom graph with a MIDISynth audio unit as the MusicDevice. If inGraph is set to NULL, the sequence will reset to use the default graph.
inSequence - the sequenceinGraph - the graphpublic static int MusicSequenceGetAUGraph(MusicSequence inSequence, org.moe.natj.general.ptr.Ptr<AUGraph> outGraph)
Gets the graph currently associated with a sequence
By default if no graph is assigned to a sequence then the sequence will create a default graph. This default graph contains a MusicDevice and a DynamicsProcessor and all tracks will be targeted to the MusicDevice. On macOS, this MusicDevice is an instance of a software synthesizer that is compatible with the GM and GS MIDI standards. On iOS, it is an instance of a monotimbral software synthesizer designed to render events from a single MIDI channel. To render multi-track GM MIDI sequences on iOS, create a custom graph with a MIDISynth audio unit as the MusicDevice.
This call will thus either return the graph as set by the user, or this default graph.
inSequence - the sequenceoutGraph - the graphpublic static int MusicSequenceSetMIDIEndpoint(MusicSequence inSequence, int inEndpoint)
Makes the target of all of the tracks in the sequence a MIDI endpoint
This is a convenience function, and is equivalent to iterating through all of the tracks in a sequence and targeting each track to the MIDI endpoint
inSequence - the sequenceinEndpoint - the MIDI endpointpublic static int MusicSequenceSetSequenceType(MusicSequence inSequence, int inType)
Set the sequence type (the default is beats)
These two calls allow you to get and set a MusicSequence type; specifying kMusicSequenceType_Beats = 'beat', kMusicSequenceType_Seconds = 'secs', kMusicSequenceType_Samples = 'samp'
The sequence type can be set to beats at any time. The sequence type can only be set to seconds or samples if there are NO tempo events already in the sequence.
For beats - it can have as many tempo events as you want For Samples and Seconds - you should add a single tempo event after setting the type Samples - the tempo is the desired sample rate - e.g. 44100 and each "beat" in the sequence will be interpreted as a sample count at that sample rate (so beat == 44100 is a second) Seconds - the tempo should be set to 60 - a beat is a second.
Beats is the default (and is the behaviour on pre 10.5 systems)
A meta event of interest for Seconds based MIDI files is the SMPTE Offset meta event - stored in the tempo track. The sequence doesn't do anything with this event (except store/write it)
inSequence - the sequenceinType - the sequence typepublic static int MusicSequenceGetSequenceType(MusicSequence inSequence, org.moe.natj.general.ptr.IntPtr outType)
Get the sequence type
See SetSequence for a full description
inSequence - the sequenceoutType - the typepublic static int MusicSequenceFileLoad(MusicSequence inSequence, CFURLRef inFileRef, int inFileTypeHint, int inFlags)
Load the data contained within the referenced file to the sequence
This function will parse the file referenced by the URL and add the events to the sequence.
inSequence - the sequenceinFileRef - a file:// URL that references a fileinFileTypeHint - provides a hint to the sequence on the file type being imported. Can be zero in many cases.inFlags - flags that can control how the data is parsed in the file and laid out in the tracks
that will be created and added to the sequence in this operationpublic static int MusicSequenceFileLoadData(MusicSequence inSequence, CFDataRef inData, int inFileTypeHint, int inFlags)
Load the data to the sequence
This function will parse the data and add the events to the sequence. The data provided needs to be of a particular file type as specified by the fileTypeHint.
inSequence - the sequenceinData - the contents of a valid file loaded into a CFData objectinFileTypeHint - provides a hint to the sequence on the file type being imported. Can be zero in many cases.inFlags - flags that can control how the data is parsed in the file and laid out in the tracks
that will be created and added to the sequence in this operationpublic static short MusicSequenceSetSMPTEResolution(byte fps,
byte ticks)
Helper function to establish the SMPTE based MIDI file resolution for the specified ticks
SMPTE resolution helpers for dealing with the interpretation and creation of tick values for standard MIDI files (see MusicSequenceFileCreate)
fps - the frames per secondticks - the ticks per quarter notepublic static void MusicSequenceGetSMPTEResolution(short inRes,
org.moe.natj.general.ptr.BytePtr fps,
org.moe.natj.general.ptr.BytePtr ticks)
Helper function to get the fps and ticks from their representation in a SMPTE based MIDI file
SMPTE resolution helpers for dealing with the interpretation and creation of tick values for standard MIDI files (see MusicSequenceFileCreate)
inRes - the resolution from a MIDI filefps - the frames per secondticks - the ticks per quarter notepublic static int MusicSequenceFileCreate(MusicSequence inSequence, CFURLRef inFileRef, int inFileType, int inFlags, short inResolution)
Create a file from a sequence
This function can be (and is most commonly) used to create a MIDI file from the events in a sequence. Only MIDI based events are used when creating the MIDI file. MIDI files are normally beat based, but can also have a SMPTE (or real-time rather than beat time) representation.
inResolution is relationship between "tick" and quarter note for saving to Standard MIDI File - pass in zero to use default - this will be the value that is currently set on the tempo track - see the comments for the set track property's time resolution
The different Sequence types determine the kinds of files that can be created:
Beats When saving a MIDI file, it saves a beats (PPQ) based axis
Seconds When saving a MIDI file, it will save it as a SMPTE resolution - so you should specify this resolution when creating the MIDI file. If zero is specified, 25 fps and 40 ticks/frame is used (a time scale of a millisecond)
Samples You cannot save to a MIDI file with this sequence type
The complete meaning of the 16-bit "division" field in a MIDI File's MThd chunk.
If it is positive, then a tick represents 1/D quarter notes.
If it negative:
bits 14-8 are a signed 7-bit number representing the SMPTE format: -24, -25, -29 (drop), -30 bits 7-0 represents the number of ticks per SMPTE frame typical values: 4, 10, 80, 100
You can obtain millisecond resolution by specifying 25 frames/sec and 40 divisions/frame.
30 fps with 80 bits (ticks) per frame: 0xE250 ((char)0xE2 == -30)
inSequence - the sequenceinFileRef - the location of the file to createinFileType - the type of file to createinFlags - flags to control the file creationinResolution - the resolution (depending on file type and sequence type)public static int MusicSequenceFileCreateData(MusicSequence inSequence, int inFileType, int inFlags, short inResolution, org.moe.natj.general.ptr.Ptr<CFDataRef> outData)
Create a data object from a sequence
The same basic parameters apply to this as with the MusicSequenceFileCreate function. The difference being that that function will create a file on disk, whereas this one will create a CFData object that is a file in memory. The CFData object should be released by the caller.
inSequence - the sequenceinFileType - the type of file to createinFlags - flags to control the file creationinResolution - the resolution (depending on file type and sequence type)outData - the resulting data objectpublic static int MusicSequenceReverse(MusicSequence inSequence)
Reverse in time all events in a sequence, including the tempo events
inSequence - the sequencepublic static int MusicSequenceGetSecondsForBeats(MusicSequence inSequence, double inBeats, org.moe.natj.general.ptr.DoublePtr outSeconds)
Returns a seconds value that would correspond to the supplied beats
Uses the sequence's tempo events
inSequence - the sequenceinBeats - the beatsoutSeconds - the seconds (time from 0 beat)public static int MusicSequenceGetBeatsForSeconds(MusicSequence inSequence, double inSeconds, org.moe.natj.general.ptr.DoublePtr outBeats)
Returns a beat value that would correspond to the supplied seconds from zero.
Uses the sequence's tempo events
inSequence - the sequenceinSeconds - the secondsoutBeats - the corresponding beatpublic static int MusicSequenceSetUserCallback(MusicSequence inSequence, AudioToolbox.Function_MusicSequenceSetUserCallback inCallback, org.moe.natj.general.ptr.VoidPtr inClientData)
Establish a user callback for a sequence
This call is used to register (or remove if inCallback is NULL) a callback that the MusicSequence will call for ANY UserEvents that are added to any of the tracks of the sequence.
If there is a callback registered, then UserEvents will be chased when MusicPlayerSetTime is called. In that case the inStartSliceBeat and inEndSliceBeat will both be the same value and will be the beat that the player is chasing too.
In normal cases, where the sequence data is being scheduled for playback, the following will apply: inStartSliceBeat <= inEventTime < inEndSliceBeat
The only exception to this is if the track that owns the MusicEvent is looping. In this case the start beat will still be less than the end beat (so your callback can still determine that it is playing, and what beats are currently being scheduled), however, the inEventTime will be the original time-stamped time of the user event.
inSequence - the sequenceinCallback - the callbackinClientData - client (user supplied) data provided back to the callback when it is called by the sequencepublic static int MusicSequenceBeatsToBarBeatTime(MusicSequence inSequence, double inBeats, int inSubbeatDivisor, CABarBeatTime outBarBeatTime)
Convenience function to format a sequence's beat time to its bar-beat time
The sequence's tempo track Time Sig events are used to to calculate the bar-beat representation. If there are no Time Sig events added to the sequence 4/4 is assumed. A Time Sig event is a MIDI Meta Event as specified for MIDI files.
inSequence - the sequenceinBeats - the beat which should be represented by the bar-beatinSubbeatDivisor - The denominator of the fractional number of beats.outBarBeatTime - the formatted bar/beat timepublic static int MusicSequenceBarBeatTimeToBeats(MusicSequence inSequence, CABarBeatTime inBarBeatTime, org.moe.natj.general.ptr.DoublePtr outBeats)
Convenience function to format a bar-beat time to a sequence's beat time
The sequence's tempo track Time Sig events are used to to calculate the bar-beat representation. If there are no Time Sig events added to the sequence 4/4 is assumed. A Time Sig event is a MIDI Meta Event as specified for MIDI files.
inSequence - the sequenceinBarBeatTime - the bar-beat timeoutBeats - the sequence's beat time for that bar-beat timepublic static CFDictionaryRef MusicSequenceGetInfoDictionary(MusicSequence inSequence)
Returns a dictionary containing meta-data derived from a sequence
The dictionary can contain one or more of the kAFInfoDictionary_*
keys specified in
The caller should release the returned dictionary. If the call fails it will return NULL
inSequence - the sequencepublic static int MusicTrackGetSequence(MusicTrack inTrack, org.moe.natj.general.ptr.Ptr<MusicSequence> outSequence)
Gets the sequence which the track is a member of
inTrack - the trackoutSequence - the track's sequencepublic static int MusicTrackSetDestNode(MusicTrack inTrack, int inNode)
Sets the track's target to the specified AUNode
The node must be a member of the graph that the track's sequence is using. When played, the track will send all of its events to that node.
inTrack - the trackinNode - the new nodepublic static int MusicTrackSetDestMIDIEndpoint(MusicTrack inTrack, int inEndpoint)
Sets the track's target to the specified MIDI endpoint
When played, the track will send all of its events to the specified MIDI Endpoint.
inTrack - the trackinEndpoint - the new MIDI endpointpublic static int MusicTrackGetDestNode(MusicTrack inTrack, org.moe.natj.general.ptr.IntPtr outNode)
Gets the track's target if it is an AUNode
Returns kAudioToolboxErr_IllegalTrackDestination if the track's target is a MIDIEndpointRef and NOT an AUNode
inTrack - the trackoutNode - the node target for the trackpublic static int MusicTrackGetDestMIDIEndpoint(MusicTrack inTrack, org.moe.natj.general.ptr.IntPtr outEndpoint)
Gets the track's target if it is a MIDI Endpoint
Returns kAudioToolboxErr_IllegalTrackDestination if the track's target is an AUNode and NOT a MIDI Endpoint
inTrack - the trackoutEndpoint - the MIDI Endpoint target for the trackpublic static int MusicTrackSetProperty(MusicTrack inTrack, int inPropertyID, org.moe.natj.general.ptr.VoidPtr inData, int inLength)
Sets the specified property value
Property values are always get and set by reference
inTrack - the trackinPropertyID - the property IDinData - the new property valueinLength - the size of the property value being setpublic static int MusicTrackGetProperty(MusicTrack inTrack, int inPropertyID, org.moe.natj.general.ptr.VoidPtr outData, org.moe.natj.general.ptr.IntPtr ioLength)
Gets the specified property value
If outData is NULL, then the size of the data will be passed back in ioLength This allows the client to allocate a buffer of the correct size (useful for variable length properties -- currently all properties have fixed size) Property values are always get and set by reference
inTrack - the trackinPropertyID - the property IDoutData - if not NULL, points to data of size ioLengthioLength - on input the available size of outData, on output the size of the valid data that outData
will then point too.public static int MusicTrackMoveEvents(MusicTrack inTrack, double inStartTime, double inEndTime, double inMoveTime)
Move events in a track
Moves all of the events in the specified time range by the moveTime. MoveTime maybe negative to move events backwards (towards zero).
All time ranges are [starttime < endtime]
inTrack - the trackinStartTime - the start time for the range of eventsinEndTime - the end time up to which will form the range of the events to moveinMoveTime - amount of beats to move the selected events.public static int MusicTrackClear(MusicTrack inTrack, double inStartTime, double inEndTime)
Removes all events within the specified range
All time ranges are [starttime < endtime]
inTrack - the trackinStartTime - the start time for the range of eventsinEndTime - the end time up to which will form the range of the events to clearpublic static int MusicTrackCut(MusicTrack inTrack, double inStartTime, double inEndTime)
Removes all the events within the specified range
Events that fall past the specified range will be moved back by the specified range time.
All time ranges are [starttime < endtime]
inTrack - the trackinStartTime - the start time for the range of eventsinEndTime - the end time up to which will form the range of the events to cut outpublic static int MusicTrackCopyInsert(MusicTrack inSourceTrack, double inSourceStartTime, double inSourceEndTime, MusicTrack inDestTrack, double inDestInsertTime)
Copies events from one track and inserts them into another
Copies all of the events with the specified time range of the source track. It then inserts those events into the destination track. All events at and after inDestInsertTime in inDestTrack are moved forward by the range's duration
All time ranges are [starttime < endtime]
inSourceTrack - the source trackinSourceStartTime - the start time for the range of eventsinSourceEndTime - the end time up to which will form the range of the events to copy from the source trackinDestTrack - the destination track to copy tooinDestInsertTime - the time at which the copied events will be inserted.public static int MusicTrackMerge(MusicTrack inSourceTrack, double inSourceStartTime, double inSourceEndTime, MusicTrack inDestTrack, double inDestInsertTime)
Copies events from one track and merges them into another
Copies all of the events with the specified time range of the source track. It then merges those events into the destination track starting at inDestInsertTime.
All time ranges are [starttime < endtime]
inSourceTrack - the source trackinSourceStartTime - the start time for the range of eventsinSourceEndTime - the end time up to which will form the range of the events to copy from the source trackinDestTrack - the destination track to copy tooinDestInsertTime - the time at which the copied events will be merged.public static int MusicTrackNewMIDINoteEvent(MusicTrack inTrack, double inTimeStamp, MIDINoteMessage inMessage)
Adds a MIDINoteMessage event to a track
The event is added at the specified time stamp. The time stamp should not be less than zero.
inTrack - the trackinTimeStamp - the time stampinMessage - the eventpublic static int MusicTrackNewMIDIChannelEvent(MusicTrack inTrack, double inTimeStamp, MIDIChannelMessage inMessage)
Adds a MIDIChannelMessage event to a track
The event is added at the specified time stamp. The time stamp should not be less than zero.
inTrack - the trackinTimeStamp - the time stampinMessage - the eventpublic static int MusicTrackNewMIDIRawDataEvent(MusicTrack inTrack, double inTimeStamp, MIDIRawData inRawData)
Adds a MIDIRawData event to a track
The event is added at the specified time stamp. The time stamp should not be less than zero.
inTrack - the trackinTimeStamp - the time stampinRawData - the eventpublic static int MusicTrackNewExtendedNoteEvent(MusicTrack inTrack, double inTimeStamp, ExtendedNoteOnEvent inInfo)
Adds a ExtendedNoteOnEvent to a track
The event is added at the specified time stamp. The time stamp should not be less than zero.
inTrack - the trackinTimeStamp - the time stampinInfo - the eventpublic static int MusicTrackNewParameterEvent(MusicTrack inTrack, double inTimeStamp, ParameterEvent inInfo)
Adds a ParameterEvent to a track
The event is added at the specified time stamp. The time stamp should not be less than zero.
inTrack - the trackinTimeStamp - the time stampinInfo - the eventpublic static int MusicTrackNewExtendedTempoEvent(MusicTrack inTrack, double inTimeStamp, double inBPM)
Adds a tempo event to a track
The event is added at the specified time stamp. The time stamp should not be less than zero.
inTrack - the trackinTimeStamp - the time stampinBPM - the eventpublic static int MusicTrackNewMetaEvent(MusicTrack inTrack, double inTimeStamp, MIDIMetaEvent inMetaEvent)
Adds a MIDIMetaEvent to a track
The event is added at the specified time stamp. The time stamp should not be less than zero.
inTrack - the trackinTimeStamp - the time stampinMetaEvent - the eventpublic static int MusicTrackNewUserEvent(MusicTrack inTrack, double inTimeStamp, MusicEventUserData inUserData)
Adds a MusicEventUserData event to a track
The event is added at the specified time stamp. The time stamp should not be less than zero.
inTrack - the trackinTimeStamp - the time stampinUserData - the eventpublic static int MusicTrackNewAUPresetEvent(MusicTrack inTrack, double inTimeStamp, AUPresetEvent inPresetEvent)
Adds a AUPresetEvent to a track
The event is added at the specified time stamp. The time stamp should not be less than zero.
inTrack - the trackinTimeStamp - the time stampinPresetEvent - the eventpublic static int NewMusicEventIterator(MusicTrack inTrack, org.moe.natj.general.ptr.Ptr<MusicEventIterator> outIterator)
Creates an iterator to iterator over a track's events
The iterator should be considered invalid if a track is edited. In that case you should create a new iterator and seek it to the desired position.
inTrack - the track upon which to iterateoutIterator - the new iteratorpublic static int DisposeMusicEventIterator(MusicEventIterator inIterator)
Dispose an iterator
inIterator - the iteratorpublic static int MusicEventIteratorSeek(MusicEventIterator inIterator, double inTimeStamp)
Move the iterator to an event at the specified time
If there is no event at the specified time, the iterator will point to the first event after that time. By specifying kMusicTimeStamp_EndOfTrack you will position the iterator to the end of track (which is pointing to the space just AFTER the last event). You can use MusicEventIteratorPreviousEvent to backup to the last event. By specifying 0, you will position the iterator at the first event
inIterator - the iteratorinTimeStamp - the time stamp to seek toopublic static int MusicEventIteratorNextEvent(MusicEventIterator inIterator)
Move the iterator to the next event
If the iterator was at the last event, then it will move past the last event and will no longer point to an event. You can use check MusicEventIteratorHasCurrentEvent to see if there is an event at the iterator's current position. See also MusicEventIteratorHasNextEvent.
Typically this call is used to move the iterator forwards through the track's events.
inIterator - the iteratorpublic static int MusicEventIteratorPreviousEvent(MusicEventIterator inIterator)
Move the iterator to the previous event
If the iterator was at the first event, then it will leave the iterator unchanged and return an error. See also MusicEventIteratorHasPreviousEvent
Typically this call is used to move the iterator backwards through the track's events.
inIterator - the iteratorpublic static int MusicEventIteratorGetEventInfo(MusicEventIterator inIterator, org.moe.natj.general.ptr.DoublePtr outTimeStamp, org.moe.natj.general.ptr.IntPtr outEventType, org.moe.natj.general.ptr.Ptr<org.moe.natj.general.ptr.ConstVoidPtr> outEventData, org.moe.natj.general.ptr.IntPtr outEventDataSize)
Retrieves the event data at the iterator.
Retrieves the event and other information from the iterator's current position.
If you do not want specific information (eg, the time stamp) pass in NULL for that parameter.
inIterator - the iteratoroutTimeStamp - the time stamp of the eventoutEventType - one of kMusicEventType_XXX that indicates what kind of event type the iterator
is currently pointing toooutEventData - a reference to the event data. The type of data is described by the eventType. This data
is read only and should not be edited in place.outEventDataSize - the size of the data referenced by outEventDatapublic static int MusicEventIteratorSetEventInfo(MusicEventIterator inIterator, int inEventType, org.moe.natj.general.ptr.ConstVoidPtr inEventData)
Changes the type or value of an event
Allows you to change either the event type, or the values of the event data, that the iterator is currently pointing too. You cannot change the event's time (to do that you should use MusicEventIteratorSetEventTime).
inIterator - the iteratorinEventType - the new (or existing) type of the event you are changinginEventData - the new event data. The size and type of this event data must match the inEventTypepublic static int MusicEventIteratorSetEventTime(MusicEventIterator inIterator, double inTimeStamp)
Set a new time for an event
The iterator will still be pointing to the same event, but as the event will have moved, it may or may not have a next or previous event now (depending of course on the time you moved it too).
inIterator - the iteratorinTimeStamp - the new time stamp of the eventpublic static int MusicEventIteratorDeleteEvent(MusicEventIterator inIterator)
Deletes the event pointed to by the iterator
The iterator will reference the next event after the event has been deleted.
inIterator - the iteratorpublic static int MusicEventIteratorHasPreviousEvent(MusicEventIterator inIterator, org.moe.natj.general.ptr.BytePtr outHasPrevEvent)
Does the track have an event previous to the event the iterator is pointing to?
To use the iterator going backwards through a track: iter = New Iterator (points at first event) MusicEventIteratorSeek (iter, kMusicTimeStamp_EndOfTrack) // will point it past the last event bool hasPreviousEvent; MusicEventIteratorHasPreviousEvent (iter, &hasPreviousEvent) while (hasPreviousEvent) { MusicEventIteratorPreviousEvent (iter) // do work... MusicEventIteratorGetEventInfo (iter, ...
MusicEventIteratorHasPreviousEvent (iter, &hasPreviousEvent); }
inIterator - the iteratoroutHasPrevEvent - true if there is a previous event, false if notpublic static int MusicEventIteratorHasNextEvent(MusicEventIterator inIterator, org.moe.natj.general.ptr.BytePtr outHasNextEvent)
Does the track have an event past the event the iterator is pointing too?
To use the iterator going forwards through a track: iter = New Iterator (points at first event) bool hasCurrentEvent; MusicEventIteratorHasCurrentEvent(iter, &hasCurrentEvent); while (hasCurrentEvent) { // do work... MusicEventIteratorGetEventInfo (iter, ...
MusicEventIteratorNextEvent (iter) MusicEventIteratorHasCurrentEvent(iter, &hasCurrentEvent); }
inIterator - the iteratoroutHasNextEvent - true if there is a next event, false if notpublic static int MusicEventIteratorHasCurrentEvent(MusicEventIterator inIterator, org.moe.natj.general.ptr.BytePtr outHasCurEvent)
Is there an event at the iterator's current position?
inIterator - the iteratoroutHasCurEvent - true if there is an event, false if notpublic static void CAShow(org.moe.natj.general.ptr.VoidPtr inObject)
public static void CAShowFile(org.moe.natj.general.ptr.VoidPtr inObject,
FILE inFile)
public static int CopyNameFromSoundBank(CFURLRef inURL, org.moe.natj.general.ptr.Ptr<CFStringRef> outName)
This will return the name of a sound bank from a DLS or SF2 bank. The name should be released by the caller.
inURL - The URL for the sound bank.outName - A pointer to a CFStringRef to be created and returned by the function.public static int CopyInstrumentInfoFromSoundBank(CFURLRef inURL, org.moe.natj.general.ptr.Ptr<CFArrayRef> outInstrumentInfo)
This will return a CFArray of CFDictionaries, one per instrument found in the DLS or SF2 bank. Each dictionary will contain four items accessed via CFStringRef versions of the keys kInstrumentInfoKey_MSB, kInstrumentInfoKey_LSB, kInstrumentInfoKey_Program, and kInstrumentInfoKey_Name. MSB: An NSNumberRef for the most-significant byte of the bank number. GM melodic banks will return 120 (0x78). GM percussion banks will return 121 (0x79). Custom banks will return their literal value. LSB: An NSNumberRef for the least-significant byte of the bank number. All GM banks will return the bank variation number (0-127). Program Number: An NSNumberRef for the program number (0-127) of an instrument within a particular bank. Name: A CFStringRef containing the name of the instrument.
Using these MSB, LSB, and Program values will guarantee that the correct instrument is loaded by the DLS synth or Sampler Audio Unit. The CFArray should be released by the caller.
inURL - The URL for the sound bank.outInstrumentInfo - A pointer to a CFArrayRef to be created and returned by the function.public static CFStringRef kAudioComponentRegistrationsChangedNotification()
Notification generated when the set of available AudioComponents changes.
Register for this notification name with `[NSNotificationCenter defaultCenter]` or `CFNotificationCenterGetLocalCenter()`, using an object of NULL.
public static CFStringRef kAudioComponentInstanceInvalidationNotification()
Notification generated when the connection to an audio unit extension process is invalidated.
Register for this notification name with `[NSNotificationCenter defaultCenter]` or `CFNotificationCenterGetLocalCenter()`. The "object" refers to an AUAudioUnit instance to be observed, or can be nil to observe all instances.
This notification can happen for several reasons, for instance the connection being invalidated or the process abnormally ending. There can be multiple notifications for the same event (i.e. a terminated process will also invalidate the connection).
The notification's userInfo dictionary may contain the following keys, depending on the reason for the invalidation and the platform in which it's running:
@Deprecated public static CFStringRef kAudioSession_RouteChangeKey_Reason()
@Deprecated public static CFStringRef kAudioSession_AudioRouteChangeKey_PreviousRouteDescription()
@Deprecated public static CFStringRef kAudioSession_AudioRouteChangeKey_CurrentRouteDescription()
@Deprecated public static CFStringRef kAudioSession_AudioRouteKey_Inputs()
@Deprecated public static CFStringRef kAudioSession_AudioRouteKey_Outputs()
@Deprecated public static CFStringRef kAudioSession_AudioRouteKey_Type()
@Deprecated public static CFStringRef kAudioSessionInputRoute_LineIn()
These are the strings used with the kAudioSession_AudioRouteKey_Type key for the CFDictionary associated with kAudioSession_AudioRouteKey_Inputs. Available in iOS 5.0 or greater [@constant] kAudioSessionInputRoute_LineIn A line in input [@constant] kAudioSessionInputRoute_BuiltInMic A built-in microphone input. (Note that some devices like early iPods do not have this input) [@constant] kAudioSessionInputRoute_HeadsetMic A microphone that is part of a headset (combined microphone and headphones) [@constant] kAudioSessionInputRoute_BluetoothHFP A microphone that is part of a Bluetooth Hands-Free Profile device [@constant] kAudioSessionInputRoute_USBAudio A Universal Serial Bus input
@Deprecated public static CFStringRef kAudioSessionInputRoute_BuiltInMic()
@Deprecated public static CFStringRef kAudioSessionInputRoute_HeadsetMic()
@Deprecated public static CFStringRef kAudioSessionInputRoute_BluetoothHFP()
@Deprecated public static CFStringRef kAudioSessionInputRoute_USBAudio()
@Deprecated public static CFStringRef kAudioSessionOutputRoute_LineOut()
These are strings used with the kAudioSession_AudioRouteKey_Type key for the CFDictionary associated with kAudioSession_AudioRouteKey_Outputs. Available in iOS 5.0 or greater [@constant] kAudioSessionOutputRoute_LineOut A line out output [@constant] kAudioSessionOutputRoute_Headphones Speakers in a headset (mic and headphones) or simple headphones [@constant] kAudioSessionOutputRoute_BluetoothHFP Speakers that are part of a Bluetooth Hands-Free Profile device [@constant] kAudioSessionOutputRoute_BluetoothA2DP Speakers in a Bluetooth A2DP device [@constant] kAudioSessionOutputRoute_BuiltInReceiver The speaker you hold to your ear when on a phone call [@constant] kAudioSessionOutputRoute_BuiltInSpeaker The built-in speaker [@constant] kAudioSessionOutputRoute_USBAudio Speaker(s) in a Universal Serial Bus device [@constant] kAudioSessionOutputRoute_HDMI Output via High-Definition Multimedia Interface [@constant] kAudioSessionOutputRoute_AirPlay Output on a remote Air Play device
@Deprecated public static CFStringRef kAudioSessionOutputRoute_Headphones()
@Deprecated public static CFStringRef kAudioSessionOutputRoute_BluetoothHFP()
@Deprecated public static CFStringRef kAudioSessionOutputRoute_BluetoothA2DP()
@Deprecated public static CFStringRef kAudioSessionOutputRoute_BuiltInReceiver()
@Deprecated public static CFStringRef kAudioSessionOutputRoute_BuiltInSpeaker()
@Deprecated public static CFStringRef kAudioSessionOutputRoute_USBAudio()
@Deprecated public static CFStringRef kAudioSessionOutputRoute_HDMI()
@Deprecated public static CFStringRef kAudioSessionOutputRoute_AirPlay()
@Deprecated public static CFStringRef kAudioSession_InputSourceKey_ID()
@Deprecated public static CFStringRef kAudioSession_InputSourceKey_Description()
@Deprecated public static CFStringRef kAudioSession_OutputDestinationKey_ID()
@Deprecated public static CFStringRef kAudioSession_OutputDestinationKey_Description()
public static int AudioUnitExtensionSetComponentList(CFStringRef extensionIdentifier, CFArrayRef audioComponentInfo)
Allows the implementor of an audio unit extension to dynamically modify the list of component registrations for the extension.
Note that the bundle ID of the process calling this API must prefix (or match) the provided extension identifier.
extensionIdentifier - The bundle ID of the audio unit extension.audioComponentInfo - An array of dictionaries, one for each component, in the same format as
described in AudioComponent.h for the Info.plist key "AudioComponents".public static CFArrayRef AudioUnitExtensionCopyComponentList(CFStringRef extensionIdentifier)
Returns the component registrations for a given audio unit extension.
extensionIdentifier - The bundle ID of the audio unit extension.public static int AudioCodecGetPropertyInfo(AudioComponentInstance inCodec, int inPropertyID, org.moe.natj.general.ptr.IntPtr outSize, org.moe.natj.general.ptr.BytePtr outWritable)
Retrieve information about the given property. The outSize argument will return the size in bytes of the current value of the property. The outWritable argument will return whether or not the property in question can be changed.
inCodec - An AudioCodec instanceinPropertyID - Property ID whose value should be readoutSize - Size in bytes of the propertyoutWritable - Flag indicating wether the underlying property can be modified or notpublic static int AudioCodecGetProperty(AudioComponentInstance inCodec, int inPropertyID, org.moe.natj.general.ptr.IntPtr ioPropertyDataSize, org.moe.natj.general.ptr.VoidPtr outPropertyData)
Retrieve the indicated property data. On input, ioDataSize has the size of the data pointed to by outPropertyData. On output, ioDataSize will contain the amount written.
inCodec - An AudioCodec instanceinPropertyID - Property ID whose value should be readioPropertyDataSize - Size in bytes of the property dataoutPropertyData - Pointer to the property data bufferpublic static int AudioCodecSetProperty(AudioComponentInstance inCodec, int inPropertyID, int inPropertyDataSize, org.moe.natj.general.ptr.ConstVoidPtr inPropertyData)
Set the indicated property data.
inCodec - An AudioCodec instanceinPropertyID - Property ID whose value should be changedinPropertyDataSize - Size in bytes of the property datainPropertyData - Pointer to the property data bufferpublic static int AudioCodecInitialize(AudioComponentInstance inCodec, AudioStreamBasicDescription inInputFormat, AudioStreamBasicDescription inOutputFormat, org.moe.natj.general.ptr.ConstVoidPtr inMagicCookie, int inMagicCookieByteSize)
This call will allocate any buffers needed and otherwise set the codec up to perform the indicated translation. If an argument is NULL, any previously set properties will be used for preparing the codec for work. Note that this routine will also validate the format information as useable.
inCodec - An AudioCodec instanceinInputFormat - Pointer to an input format structureinOutputFormat - Pointer to an output format structureinMagicCookie - Pointer to the magic cookieinMagicCookieByteSize - Size in bytes of the magic cookiepublic static int AudioCodecUninitialize(AudioComponentInstance inCodec)
This call will move the codec from the initialized state back to the uninitialized state. The codec will release any resources it allocated or claimed in AudioCodecInitialize.
inCodec - An AudioCodec instancepublic static int AudioCodecAppendInputData(AudioComponentInstance inCodec, org.moe.natj.general.ptr.ConstVoidPtr inInputData, org.moe.natj.general.ptr.IntPtr ioInputDataByteSize, org.moe.natj.general.ptr.IntPtr ioNumberPackets, AudioStreamPacketDescription inPacketDescription)
Append as much of the given data in inInputData to the codec's input buffer as possible and return in ioInputDataByteSize the amount of data used.
The inPacketDescription argument is an array of AudioStreamPacketDescription structs that describes the packet layout. The number of elements in this array is indicated on input by ioNumberPackets. On return, this number indicates the number of packets consumed.
Note also in this case that it is an error to supply less than a full packet of data at a time.
inCodec - An AudioCodec instanceinInputData - A const pointer to the input dataioInputDataByteSize - The size in bytes of the input data in inInputData on input,
the number of bytes consumed on outputioNumberPackets - The number of packetsinPacketDescription - The packet description pointerpublic static int AudioCodecProduceOutputPackets(AudioComponentInstance inCodec, org.moe.natj.general.ptr.VoidPtr outOutputData, org.moe.natj.general.ptr.IntPtr ioOutputDataByteSize, org.moe.natj.general.ptr.IntPtr ioNumberPackets, AudioStreamPacketDescription outPacketDescription, org.moe.natj.general.ptr.IntPtr outStatus)
Produce as many output packets as requested and the amount of input data allows for. The outStatus argument returns information about the codec's status to allow for proper data management. See the constants above for the possible values that can be returned.
The outPacketDescription argument is an array of AudioStreamPacketDescription structs that describes the packet layout returned in outOutputData. This argument is optional. Pass NULL if this information is not to be returned. Note that this information is only provided when the output format isn't linear PCM.
Note that decoders will always only produce linear PCM data in multiples of the number frames in a packet of the encoded format (as returned by kAudioCodecPropertyPacketFrameSize). Encoders will consume this many frames of linear PCM data to produce a packet of their format.
inCodec - The AudioCodec instanceoutOutputData - Pointer to the output data bufferioOutputDataByteSize - A pointer to the sizeioNumberPackets - number of input/output packetspublic static int AudioCodecAppendInputBufferList(AudioComponentInstance inCodec, AudioBufferList inBufferList, org.moe.natj.general.ptr.IntPtr ioNumberPackets, AudioStreamPacketDescription inPacketDescription, org.moe.natj.general.ptr.IntPtr outBytesConsumed)
public static int AudioCodecProduceOutputBufferList(AudioComponentInstance inCodec, AudioBufferList ioBufferList, org.moe.natj.general.ptr.IntPtr ioNumberPackets, AudioStreamPacketDescription outPacketDescription, org.moe.natj.general.ptr.IntPtr outStatus)
public static int AudioCodecReset(AudioComponentInstance inCodec)
Flushes all the data in the codec and clears the input buffer. Note that the formats, and magic cookie will be retained so they won't need to be set up again to decode the same data.
inCodec - The audio codec descriptorpublic static UIImage AudioComponentCopyIcon(AudioComponent comp)
Fetches an icon representing the component.
For a component originating in an app extension, the returned icon will be that of the application containing the extension.
For components loaded from bundles, the icon will be that of the bundle.
The caller is responsible to release this value when done with it.
comp - The component whose icon data is to be retrieved.public static OS_os_workgroup AudioWorkIntervalCreate(java.lang.String name, int clock, os_workgroup_attr_opaque_s attr)
Create an OS workgroup interval for use with audio realtime threads.
name - A name for the created work interval.clock - The clockid in which interval timestamps are specified, e.g. `OS_CLOCK_MACH_ABSOLUTE_TIME`
from attr - This field is currently not used and should be NULL.public static int MusicDeviceMIDIEventList(AudioComponentInstance inUnit, int inOffsetSampleFrame, MIDIEventList evtList)
Used to send MIDI messages to an audio unit
This API is suitable for sending Universal MIDI Packet (UMP) MIDI messages to an audio unit. The message must be a full non-SysEx event, a partial SysEx event, or a complete SysEx event. Running status is not allowed. MIDI 1.0 in universal packets (MIDI-1UP) and MIDI 2.0 messages are allowed. All events sent via MusicDeviceMIDIEventList will be delivered to the audio unit in the MIDI protocol returned by kAudioUnitProperty_AudioUnitMIDIProtocol.
This is bridged to the v2 API property kAudioUnitProperty_MIDIOutputCallback.
evtList - The MIDIEventList to be sentinUnit - The audio unitinOffsetSampleFrame - If you are scheduling the MIDIEventList from the audio unit's render thread, then you can supply a
sample offset that the audio unit may apply within its next audio unit render.
This allows you to schedule to the sample, the time when a MIDI command is applied and is particularly
important when starting new notes. If you are not scheduling in the audio unit's render thread,
then you should set this value to 0
inOffsetSampleFrame should serve as the base offset for each packet's timestamp i.e. sampleOffset = inOffsetSampleFrame + evtList.packet[0].timeStamp