AEFloatConverter Class Reference

Universal converter to float format. More...

#import <AEFloatConverter.h>

Inherits <NSObject>.

Instance Methods

(id) - initWithSourceFormat:
 Initialize.
 
(BOOL) - AEFloatConverterToFloat
 Convert audio to floating-point.
 
(BOOL) - AEFloatConverterToFloatBufferList
 Convert audio to floating-point, in a buffer list.
 
(BOOL) - AEFloatConverterFromFloat
 Convert audio from floating-point.
 
(BOOL) - AEFloatConverterFromFloatBufferList
 Convert audio from floating-point, in a buffer list.
 

Properties

AudioStreamBasicDescription floatingPointAudioDescription
 The AudioStreamBasicDescription representing the converted floating-point format.
 
AudioStreamBasicDescription sourceFormat
 The source audio format set at initialization.
 
int floatFormatChannelsPerFrame
 The number of channels for the floating-point format.
 

Detailed Description

Universal converter to float format.

Use this class to easily convert arbitrary audio formats to floating point for use with utilities like the Accelerate framework.

Method Documentation

- (id) initWithSourceFormat: (AudioStreamBasicDescription)  sourceFormat

Initialize.

Parameters
sourceFormatThe audio format to use
- (BOOL) AEFloatConverterToFloat (AEFloatConverter *)  converter
(AudioBufferList *)  sourceBuffer
(float *const *)  targetBuffers
(UInt32)  frames 

Convert audio to floating-point.

This C function, safe to use in a Core Audio realtime thread context, will take an audio buffer list of audio in the format you provided at initialisation, and convert it into a noninterleaved float array.

Parameters
converterPointer to the converter object.
sourceBufferAn audio buffer list containing the source audio.
targetBuffersAn array of floating-point arrays to store the converted float audio into. Note that you must provide the correct number of arrays, to match the number of channels.
framesThe number of frames to convert.
Returns
YES on success; NO on failure
- (BOOL) AEFloatConverterToFloatBufferList (AEFloatConverter *)  converter
(AudioBufferList *)  sourceBuffer
(AudioBufferList *)  targetBuffer
(UInt32)  frames 

Convert audio to floating-point, in a buffer list.

This C function, safe to use in a Core Audio realtime thread context, will take an audio buffer list of audio in the format you provided at initialisation, and convert it into a noninterleaved float format.

Parameters
converterPointer to the converter object.
sourceBufferAn audio buffer list containing the source audio.
targetBufferAn audio buffer list to store the converted floating-point audio.
framesThe number of frames to convert.
Returns
YES on success; NO on failure
- (BOOL) AEFloatConverterFromFloat (AEFloatConverter *)  converter
(float *const *)  sourceBuffers
(AudioBufferList *)  targetBuffer
(UInt32)  frames 

Convert audio from floating-point.

This C function, safe to use in a Core Audio realtime thread context, will take an audio buffer list of audio in the format you provided at initialisation, and convert it into a float array.

Parameters
converterPointer to the converter object.
sourceBuffersAn array of floating-point arrays containing the floating-point audio to convert. Note that you must provide the correct number of arrays, to match the number of channels.
targetBufferAn audio buffer list to store the converted audio into.
framesThe number of frames to convert.
Returns
YES on success; NO on failure
- (BOOL) AEFloatConverterFromFloatBufferList (AEFloatConverter *)  converter
(AudioBufferList *)  sourceBuffer
(AudioBufferList *)  targetBuffer
(UInt32)  frames 

Convert audio from floating-point, in a buffer list.

This C function, safe to use in a Core Audio realtime thread context, will take an audio buffer list of audio in the format you provided at initialisation, and convert it into a float array.

Parameters
converterPointer to the converter object.
sourceBufferAn audio buffer list containing the source audio.
targetBufferAn audio buffer list to store the converted audio into.
framesThe number of frames to convert.
Returns
YES on success; NO on failure

Property Documentation

- (AudioStreamBasicDescription) floatingPointAudioDescription
readnonatomicassign

The AudioStreamBasicDescription representing the converted floating-point format.

- (AudioStreamBasicDescription) sourceFormat
readwritenonatomicassign

The source audio format set at initialization.

- (int) floatFormatChannelsPerFrame
readwritenonatomicassign

The number of channels for the floating-point format.


The documentation for this class was generated from the following file: