EZAudio

@interface EZAudio : NSObject

EZAudio is a simple, intuitive framework for iOS and OSX. The goal of EZAudio was to provide a modular, cross-platform framework to simplify performing everyday audio operations like getting microphone input, creating audio waveforms, recording/playing audio files, etc. The visualization tools like the EZAudioPlot and EZAudioPlotGL were created to plug right into the framework’s various components and provide highly optimized drawing routines that work in harmony with audio callback loops. All components retain the same namespace whether you’re on an iOS device or a Mac computer so an EZAudioPlot understands it will subclass an UIView on an iOS device or an NSView on a Mac.

Class methods for EZAudio are provided as utility methods used throughout the other modules within the framework. For instance, these methods help make sense of error codes (checkResult:operation:), map values betwen coordinate systems (MAP:leftMin:leftMax:rightMin:rightMax:), calculate root mean squared values for buffers (RMS:length:), etc.

Warning

As of 1.0 these methods have been moved over to EZAudioUtilities to allow using specific modules without requiring the whole library.
  • Globally sets whether or not the program should exit if a checkResult:operation: operation fails. Currently the behavior on EZAudio is to quit if a checkResult:operation: fails, but this is not desirable in any production environment. Internally there are a lot of checkResult:operation: operations used on all the core classes. This should only ever be set to NO in production environments since a checkResult:operation: failing means something breaking has likely happened. - parameter: shouldExitOnCheckResultFail A BOOL indicating whether or not the running program should exist due to a checkResult:operation: fail. @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead.

    Declaration

    Objective-C

    + (void)setShouldExitOnCheckResultFail:(BOOL)shouldExitOnCheckResultFail;

    Swift

    class func setShouldExitOnCheckResultFail(_ shouldExitOnCheckResultFail: Bool)

    Parameters

    shouldExitOnCheckResultFail

    A BOOL indicating whether or not the running program should exist due to a checkResult:operation: fail.

  • Provides a flag indicating whether or not the program will exit if a checkResult:operation: fails. @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead. - returns: A BOOL indicating whether or not the program will exit if a checkResult:operation: fails.

    Declaration

    Objective-C

    + (BOOL)shouldExitOnCheckResultFail;

    Swift

    class func shouldExitOnCheckResultFail() -> Bool

    Return Value

    A BOOL indicating whether or not the program will exit if a checkResult:operation: fails.

  • Allocates an AudioBufferList structure. Make sure to call freeBufferList when done using AudioBufferList or it will leak. - parameter: frames The number of frames that will be stored within each audio buffer - parameter: channels The number of channels (e.g. 2 for stereo, 1 for mono, etc.) - parameter: interleaved Whether the samples will be interleaved (if not it will be assumed to be non-interleaved and each channel will have an AudioBuffer allocated) @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead. - returns: An AudioBufferList struct that has been allocated in memory

    Declaration

    Objective-C

    + (AudioBufferList *)audioBufferListWithNumberOfFrames:(UInt32)frames
                                          numberOfChannels:(UInt32)channels
                                               interleaved:(BOOL)interleaved;

    Swift

    class func audioBufferList(withNumberOfFrames frames: UInt32, numberOfChannels channels: UInt32, interleaved: Bool) -> UnsafeMutablePointer

    Parameters

    frames

    The number of frames that will be stored within each audio buffer

    channels

    The number of channels (e.g. 2 for stereo, 1 for mono, etc.)

    interleaved

    Whether the samples will be interleaved (if not it will be assumed to be non-interleaved and each channel will have an AudioBuffer allocated)

    Return Value

    An AudioBufferList struct that has been allocated in memory

  • Allocates an array of float arrays given the number of frames needed to store in each float array. - parameter: frames A UInt32 representing the number of frames to store in each float buffer - parameter: channels A UInt32 representing the number of channels (i.e. the number of float arrays to allocate) @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead. - returns: An array of float arrays, each the length of the number of frames specified

    Declaration

    Objective-C

    + (float **)floatBuffersWithNumberOfFrames:(UInt32)frames
                              numberOfChannels:(UInt32)channels;

    Swift

    class func floatBuffers(withNumberOfFrames frames: UInt32, numberOfChannels channels: UInt32) -> UnsafeMutablePointer

    Parameters

    frames

    A UInt32 representing the number of frames to store in each float buffer

    channels

    A UInt32 representing the number of channels (i.e. the number of float arrays to allocate)

    Return Value

    An array of float arrays, each the length of the number of frames specified

  • Deallocates an AudioBufferList structure from memory. - parameter: bufferList A pointer to the buffer list you would like to free @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead.

    Declaration

    Objective-C

    + (void)freeBufferList:(AudioBufferList *)bufferList;

    Swift

    class func freeBufferList(_ bufferList: UnsafeMutablePointer

    Parameters

    bufferList

    A pointer to the buffer list you would like to free

  • Deallocates an array of float buffers - parameter: buffers An array of float arrays - parameter: channels A UInt32 representing the number of channels (i.e. the number of float arrays to deallocate) @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead.

    Declaration

    Objective-C

    + (void)freeFloatBuffers:(float **)buffers numberOfChannels:(UInt32)channels;

    Swift

    class func freeFloatBuffers(_ buffers: UnsafeMutablePointer

    Parameters

    buffers

    An array of float arrays

    channels

    A UInt32 representing the number of channels (i.e. the number of float arrays to deallocate)

  • Creates a signed-integer, interleaved AudioStreamBasicDescription for the number of channels specified for an AIFF format. - parameter: channels The desired number of channels - parameter: sampleRate A float representing the sample rate. @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead. - returns: A new AudioStreamBasicDescription with the specified format.

    Declaration

    Objective-C

    + (AudioStreamBasicDescription)AIFFFormatWithNumberOfChannels:(UInt32)channels
                                                       sampleRate:(float)sampleRate;

    Swift

    class func aiffFormat(withNumberOfChannels channels: UInt32, sampleRate: Float) -> AudioStreamBasicDescription

    Parameters

    channels

    The desired number of channels

    sampleRate

    A float representing the sample rate.

    Return Value

    A new AudioStreamBasicDescription with the specified format.

  • Creates an AudioStreamBasicDescription for the iLBC narrow band speech codec. - parameter: sampleRate A float representing the sample rate. @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead. - returns: A new AudioStreamBasicDescription with the specified format.

    Declaration

    Objective-C

    + (AudioStreamBasicDescription)iLBCFormatWithSampleRate:(float)sampleRate;

    Swift

    class func iLBCFormat(withSampleRate sampleRate: Float) -> AudioStreamBasicDescription

    Parameters

    sampleRate

    A float representing the sample rate.

    Return Value

    A new AudioStreamBasicDescription with the specified format.

  • Creates a float-based, non-interleaved AudioStreamBasicDescription for the number of channels specified. - parameter: channels A UInt32 representing the number of channels. - parameter: sampleRate A float representing the sample rate. @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead. - returns: A float-based AudioStreamBasicDescription with the number of channels specified.

    Declaration

    Objective-C

    + (AudioStreamBasicDescription)floatFormatWithNumberOfChannels:(UInt32)channels
                                                        sampleRate:
                                                            (float)sampleRate;

    Swift

    class func floatFormat(withNumberOfChannels channels: UInt32, sampleRate: Float) -> AudioStreamBasicDescription

    Parameters

    channels

    A UInt32 representing the number of channels.

    sampleRate

    A float representing the sample rate.

    Return Value

    A float-based AudioStreamBasicDescription with the number of channels specified.

  • Creates an AudioStreamBasicDescription for an M4A AAC format. - parameter: channels The desired number of channels - parameter: sampleRate A float representing the sample rate. @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead. - returns: A new AudioStreamBasicDescription with the specified format.

    Declaration

    Objective-C

    + (AudioStreamBasicDescription)M4AFormatWithNumberOfChannels:(UInt32)channels
                                                      sampleRate:(float)sampleRate;

    Swift

    class func m4AFormat(withNumberOfChannels channels: UInt32, sampleRate: Float) -> AudioStreamBasicDescription

    Parameters

    channels

    The desired number of channels

    sampleRate

    A float representing the sample rate.

    Return Value

    A new AudioStreamBasicDescription with the specified format.

  • Creates a single-channel, float-based AudioStreamBasicDescription. - parameter: sampleRate A float representing the sample rate. @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead. - returns: A new AudioStreamBasicDescription with the specified format.

    Declaration

    Objective-C

    + (AudioStreamBasicDescription)monoFloatFormatWithSampleRate:(float)sampleRate;

    Swift

    class func monoFloatFormat(withSampleRate sampleRate: Float) -> AudioStreamBasicDescription

    Parameters

    sampleRate

    A float representing the sample rate.

    Return Value

    A new AudioStreamBasicDescription with the specified format.

  • Creates a single-channel, float-based AudioStreamBasicDescription (as of 0.0.6 this is the same as monoFloatFormatWithSampleRate:). - parameter: sampleRate A float representing the sample rate. - returns: A new AudioStreamBasicDescription with the specified format. @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead.

    Declaration

    Objective-C

    + (AudioStreamBasicDescription)monoCanonicalFormatWithSampleRate:
        (float)sampleRate;

    Swift

    class func monoCanonicalFormat(withSampleRate sampleRate: Float) -> AudioStreamBasicDescription

    Parameters

    sampleRate

    A float representing the sample rate.

    Return Value

    A new AudioStreamBasicDescription with the specified format.

  • Creates a two-channel, non-interleaved, float-based AudioStreamBasicDescription (as of 0.0.6 this is the same as stereoFloatNonInterleavedFormatWithSampleRate:). - parameter: sampleRate A float representing the sample rate. @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead. - returns: A new AudioStreamBasicDescription with the specified format.

    Declaration

    Objective-C

    + (AudioStreamBasicDescription)
    stereoCanonicalNonInterleavedFormatWithSampleRate:(float)sampleRate;

    Swift

    class func stereoCanonicalNonInterleavedFormat(withSampleRate sampleRate: Float) -> AudioStreamBasicDescription

    Parameters

    sampleRate

    A float representing the sample rate.

    Return Value

    A new AudioStreamBasicDescription with the specified format.

  • Creates a two-channel, interleaved, float-based AudioStreamBasicDescription. - parameter: sampleRate A float representing the sample rate. @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead. - returns: A new AudioStreamBasicDescription with the specified format.

    Declaration

    Objective-C

    + (AudioStreamBasicDescription)stereoFloatInterleavedFormatWithSampleRate:
        (float)sampleRate;

    Swift

    class func stereoFloatInterleavedFormat(withSampleRate sampleRate: Float) -> AudioStreamBasicDescription

    Parameters

    sampleRate

    A float representing the sample rate.

    Return Value

    A new AudioStreamBasicDescription with the specified format.

  • Creates a two-channel, non-interleaved, float-based AudioStreamBasicDescription. - parameter: sampleRate A float representing the sample rate. @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead. - returns: A new AudioStreamBasicDescription with the specified format.

    Declaration

    Objective-C

    + (AudioStreamBasicDescription)stereoFloatNonInterleavedFormatWithSampleRate:
        (float)sampleRate;

    Swift

    class func stereoFloatNonInterleavedFormat(withSampleRate sampleRate: Float) -> AudioStreamBasicDescription

    Parameters

    sampleRate

    A float representing the sample rate.

    Return Value

    A new AudioStreamBasicDescription with the specified format.

  • Checks an AudioStreamBasicDescription to see if it is a float-based format (as opposed to a signed integer based format). - parameter: asbd A valid AudioStreamBasicDescription @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead. - returns: A BOOL indicating whether or not the AudioStreamBasicDescription is a float format.

    Declaration

    Objective-C

    + (BOOL)isFloatFormat:(AudioStreamBasicDescription)asbd;

    Swift

    class func isFloatFormat(_ asbd: AudioStreamBasicDescription) -> Bool

    Parameters

    asbd

    A valid AudioStreamBasicDescription

    Return Value

    A BOOL indicating whether or not the AudioStreamBasicDescription is a float format.

  • Checks an AudioStreamBasicDescription to check for an interleaved flag (samples are stored in one buffer one after another instead of two (or n channels) parallel buffers - parameter: asbd A valid AudioStreamBasicDescription @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead. - returns: A BOOL indicating whether or not the AudioStreamBasicDescription is interleaved

    Declaration

    Objective-C

    + (BOOL)isInterleaved:(AudioStreamBasicDescription)asbd;

    Swift

    class func isInterleaved(_ asbd: AudioStreamBasicDescription) -> Bool

    Parameters

    asbd

    A valid AudioStreamBasicDescription

    Return Value

    A BOOL indicating whether or not the AudioStreamBasicDescription is interleaved

  • Checks an AudioStreamBasicDescription to see if it is a linear PCM format (uncompressed, 1 frame per packet) - parameter: asbd A valid AudioStreamBasicDescription @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead. - returns: A BOOL indicating whether or not the AudioStreamBasicDescription is linear PCM.

    Declaration

    Objective-C

    + (BOOL)isLinearPCM:(AudioStreamBasicDescription)asbd;

    Swift

    class func isLinearPCM(_ asbd: AudioStreamBasicDescription) -> Bool

    Parameters

    asbd

    A valid AudioStreamBasicDescription

    Return Value

    A BOOL indicating whether or not the AudioStreamBasicDescription is linear PCM.

  • Nicely logs out the contents of an AudioStreamBasicDescription struct - parameter: asbd The AudioStreamBasicDescription struct with content to print out @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead.

    Declaration

    Objective-C

    + (void)printASBD:(AudioStreamBasicDescription)asbd;

    Swift

    class func printASBD(_ asbd: AudioStreamBasicDescription)

    Parameters

    asbd

    The AudioStreamBasicDescription struct with content to print out

  • Converts seconds into a string formatted as MM:SS - parameter: seconds An NSTimeInterval representing the number of seconds @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead. - returns: An NSString instance formatted as MM:SS from the seconds provided.

    Declaration

    Objective-C

    + (NSString *)displayTimeStringFromSeconds:(NSTimeInterval)seconds;

    Swift

    class func displayTimeString(fromSeconds seconds: TimeInterval) -> String!

    Parameters

    seconds

    An NSTimeInterval representing the number of seconds

    Return Value

    An NSString instance formatted as MM:SS from the seconds provided.

  • Creates a string to use when logging out the contents of an AudioStreamBasicDescription - parameter: asbd A valid AudioStreamBasicDescription struct. @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead. - returns: An NSString representing the contents of the AudioStreamBasicDescription.

    Declaration

    Objective-C

    + (NSString *)stringForAudioStreamBasicDescription:
        (AudioStreamBasicDescription)asbd;

    Swift

    class func string(for asbd: AudioStreamBasicDescription) -> String!

    Parameters

    asbd

    A valid AudioStreamBasicDescription struct.

    Return Value

    An NSString representing the contents of the AudioStreamBasicDescription.

  • Just a wrapper around the setCanonical function provided in the Core Audio Utility C++ class. - parameter: asbd The AudioStreamBasicDescription structure to modify - parameter: nChannels The number of expected channels on the description - parameter: interleaved A flag indicating whether the stereo samples should be interleaved in the buffer @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead.

    Declaration

    Objective-C

    + (void)setCanonicalAudioStreamBasicDescription:
                (AudioStreamBasicDescription *)asbd
                                   numberOfChannels:(UInt32)nChannels
                                        interleaved:(BOOL)interleaved;

    Swift

    class func setCanonicalAudioStreamBasicDescription(_ asbd: UnsafeMutablePointer

    Parameters

    asbd

    The AudioStreamBasicDescription structure to modify

    nChannels

    The number of expected channels on the description

    interleaved

    A flag indicating whether the stereo samples should be interleaved in the buffer

  • Appends an array of values to a history buffer and performs an internal shift to add the values to the tail and removes the same number of values from the head. - parameter: buffer A float array of values to append to the tail of the history buffer - parameter: bufferLength The length of the float array being appended to the history buffer - parameter: scrollHistory The target history buffer in which to append the values - parameter: scrollHistoryLength The length of the target history buffer @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead.

    Declaration

    Objective-C

    + (void)appendBufferAndShift:(float *)buffer
                  withBufferSize:(int)bufferLength
                 toScrollHistory:(float *)scrollHistory
           withScrollHistorySize:(int)scrollHistoryLength;

    Swift

    class func appendBufferAndShift(_ buffer: UnsafeMutablePointer

    Parameters

    buffer

    A float array of values to append to the tail of the history buffer

    bufferLength

    The length of the float array being appended to the history buffer

    scrollHistory

    The target history buffer in which to append the values

    scrollHistoryLength

    The length of the target history buffer

  • Appends a value to a history buffer and performs an internal shift to add the value to the tail and remove the 0th value. - parameter: value The float value to append to the history array - parameter: scrollHistory The target history buffer in which to append the values - parameter: scrollHistoryLength The length of the target history buffer @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead.

    Declaration

    Objective-C

    + (void)appendValue:(float)value
              toScrollHistory:(float *)scrollHistory
        withScrollHistorySize:(int)scrollHistoryLength;

    Swift

    class func appendValue(_ value: Float, toScrollHistory scrollHistory: UnsafeMutablePointer

    Parameters

    value

    The float value to append to the history array

    scrollHistory

    The target history buffer in which to append the values

    scrollHistoryLength

    The length of the target history buffer

  • Maps a value from one coordinate system into another one. Takes in the current value to map, the minimum and maximum values of the first coordinate system, and the minimum and maximum values of the second coordinate system and calculates the mapped value in the second coordinate system’s constraints. - parameter: value The value expressed in the first coordinate system - parameter: leftMin The minimum of the first coordinate system - parameter: leftMax The maximum of the first coordinate system - parameter: rightMin The minimum of the second coordindate system - parameter: rightMax The maximum of the second coordinate system @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead. @return The mapped value in terms of the second coordinate system

    Declaration

    Objective-C

    + (float)MAP:(float)value
         leftMin:(float)leftMin
         leftMax:(float)leftMax
        rightMin:(float)rightMin
        rightMax:(float)rightMax;

    Swift

    class func map(_ value: Float, leftMin: Float, leftMax: Float, rightMin: Float, rightMax: Float) -> Float

    Parameters

    value

    The value expressed in the first coordinate system

    leftMin

    The minimum of the first coordinate system

    leftMax

    The maximum of the first coordinate system

    rightMin

    The minimum of the second coordindate system

    rightMax

    The maximum of the second coordinate system

    Return Value

    The mapped value in terms of the second coordinate system

  • Calculates the root mean squared for a buffer. - parameter: buffer A float buffer array of values whose root mean squared to calculate - parameter: bufferSize The size of the float buffer @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead. @return The root mean squared of the buffer

    Declaration

    Objective-C

    + (float)RMS:(float *)buffer length:(int)bufferSize;

    Swift

    class func rms(_ buffer: UnsafeMutablePointer

    Parameters

    buffer

    A float buffer array of values whose root mean squared to calculate

    bufferSize

    The size of the float buffer

    Return Value

    The root mean squared of the buffer

  • Calculate the sign function sgn(x) = { -1 , x < 0, { 0 , x = 0, { 1 , x > 0 - parameter: value The float value for which to use as x @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead. - returns: The float sign value

    Declaration

    Objective-C

    + (float)SGN:(float)value;

    Swift

    class func sgn(_ value: Float) -> Float

    Parameters

    value

    The float value for which to use as x

    Return Value

    The float sign value

  • Basic check result function useful for checking each step of the audio setup process - parameter: result The OSStatus representing the result of an operation - parameter: operation A string (const char, not NSString) describing the operation taking place (will print if fails) @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead.

    Declaration

    Objective-C

    + (void)checkResult:(OSStatus)result operation:(const char *)operation;

    Swift

    class func checkResult(_ result: OSStatus, operation: UnsafePointer

    Parameters

    result

    The OSStatus representing the result of an operation

    operation

    A string (const char, not NSString) describing the operation taking place (will print if fails)

  • Provides a string representation of the often cryptic Core Audio error codes - parameter: code A UInt32 representing an error code @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead. - returns: An NSString with a human readable version of the error code.

    Declaration

    Objective-C

    + (NSString *)stringFromUInt32Code:(UInt32)code;

    Swift

    class func string(fromUInt32Code code: UInt32) -> String!

    Parameters

    code

    A UInt32 representing an error code

    Return Value

    An NSString with a human readable version of the error code.

  • Given a buffer representing a window of float history data this append the RMS of a buffer of incoming float data…This will likely be deprecated in a future version of EZAudio for a circular buffer based approach. - parameter: scrollHistory An array of float arrays being used to hold the history values for each channel. - parameter: scrollHistoryLength An int representing the length of the history window. - parameter: index An int pointer to the index of the current read index of the history buffer. - parameter: buffer A float array representing the incoming audio data. - parameter: bufferSize An int representing the length of the incoming audio data. - parameter: isChanging A BOOL pointer representing whether the resolution (length of the history window) is currently changing. @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead.

    Declaration

    Objective-C

    + (void)updateScrollHistory:(float **)scrollHistory
                     withLength:(int)scrollHistoryLength
                        atIndex:(int *)index
                     withBuffer:(float *)buffer
                 withBufferSize:(int)bufferSize
           isResolutionChanging:(BOOL *)isChanging;

    Swift

    class func updateScrollHistory(_ scrollHistory: UnsafeMutablePointer

    Parameters

    scrollHistory

    An array of float arrays being used to hold the history values for each channel.

    scrollHistoryLength

    An int representing the length of the history window.

    index

    An int pointer to the index of the current read index of the history buffer.

    buffer

    A float array representing the incoming audio data.

    bufferSize

    An int representing the length of the incoming audio data.

    isChanging

    A BOOL pointer representing whether the resolution (length of the history window) is currently changing.

  • Appends the data from the audio buffer list to the circular buffer - parameter: circularBuffer Pointer to the instance of the TPCircularBuffer to add the audio data to - parameter: audioBufferList Pointer to the instance of the AudioBufferList with the audio data @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead.

    Declaration

    Objective-C

    + (void)appendDataToCircularBuffer:(TPCircularBuffer *)circularBuffer
                   fromAudioBufferList:(AudioBufferList *)audioBufferList;

    Swift

    class func appendData(to circularBuffer: UnsafeMutablePointer

    Parameters

    circularBuffer

    Pointer to the instance of the TPCircularBuffer to add the audio data to

    audioBufferList

    Pointer to the instance of the AudioBufferList with the audio data

  • Initializes the circular buffer (just a wrapper around the C method) - parameter: circularBuffer Pointer to an instance of the TPCircularBuffer - parameter: size The length of the TPCircularBuffer (usually 1024) @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead.

    Declaration

    Objective-C

    + (void)circularBuffer:(TPCircularBuffer *)circularBuffer withSize:(int)size;

    Swift

    class func circularBuffer(_ circularBuffer: UnsafeMutablePointer

    Parameters

    circularBuffer

    Pointer to an instance of the TPCircularBuffer

    size

    The length of the TPCircularBuffer (usually 1024)

  • Frees a circular buffer - parameter: circularBuffer Pointer to the circular buffer to clear @deprecated This method is deprecated starting in version 0.1.0. - note: Please use same method in EZAudioUtilities class instead.

    Declaration

    Objective-C

    + (void)freeCircularBuffer:(TPCircularBuffer *)circularBuffer;

    Swift

    class func freeCircularBuffer(_ circularBuffer: UnsafeMutablePointer

    Parameters

    circularBuffer

    Pointer to the circular buffer to clear