Go to the source code of this file.
Macros | |
#define | AECheckOSStatus(result, operation) (_AECheckOSStatus((result),(operation),strrchr(__FILE__, '/')+1,__LINE__)) |
Check an OSStatus condition. | |
Functions | |
AudioComponentDescription | AEAudioComponentDescriptionMake (OSType manufacturer, OSType type, OSType subtype) |
Create an AudioComponentDescription structure. | |
BOOL | AERateLimit (void) |
Rate limit an operation. | |
void | AEError (OSStatus result, const char *_Nonnull operation, const char *_Nonnull file, int line) |
An error occurred within AECheckOSStatus. | |
ExtAudioFileRef _Nullable | AEExtAudioFileCreate (NSURL *_Nonnull url, AEAudioFileType fileType, double sampleRate, int channelCount, NSError *_Nullable *_Nullable error) |
Initialize an ExtAudioFileRef for writing to a file. | |
ExtAudioFileRef _Nullable | AEExtAudioFileOpen (NSURL *_Nonnull url, AudioStreamBasicDescription *_Nullable outAudioDescription, UInt64 *_Nullable outLengthInFrames, NSError *_Nullable *_Nullable error) |
Open an audio file for reading. | |
#define AECheckOSStatus | ( | result, | |
operation | |||
) | (_AECheckOSStatus((result),(operation),strrchr(__FILE__, '/')+1,__LINE__)) |
Check an OSStatus condition.
result | The result |
operation | A description of the operation, for logging purposes |
AudioComponentDescription AEAudioComponentDescriptionMake | ( | OSType | manufacturer, |
OSType | type, | ||
OSType | subtype | ||
) |
Create an AudioComponentDescription structure.
manufacturer | The audio component manufacturer (e.g. kAudioUnitManufacturer_Apple) |
type | The type (e.g. kAudioUnitType_Generator) |
subtype | The subtype (e.g. kAudioUnitSubType_AudioFilePlayer) |
BOOL AERateLimit | ( | void | ) |
Rate limit an operation.
This can be used to prevent spamming error messages to the console when something goes wrong.
void AEError | ( | OSStatus | result, |
const char *_Nonnull | operation, | ||
const char *_Nonnull | file, | ||
int | line | ||
) |
An error occurred within AECheckOSStatus.
Create a symbolic breakpoint with this function name to break on errors.
ExtAudioFileRef _Nullable AEExtAudioFileCreate | ( | NSURL *_Nonnull | url, |
AEAudioFileType | fileType, | ||
double | sampleRate, | ||
int | channelCount, | ||
NSError *_Nullable *_Nullable | error | ||
) |
Initialize an ExtAudioFileRef for writing to a file.
This provides a simple way to create an audio file writer, initialised appropriately for the given file type. To begin recording asynchronously, you should use ExtAudioFileWriteAsync(audioFile, 0, NULL);
to prime asynchronous recording. For writing on the main thread, use ExtAudioFileWrite
.
Finish writing and close the file by using ExtAudioFileDispose
once you are done.
Use this function only on the main thread.
url | URL to the file to write to |
fileType | The type of the file to write |
sampleRate | Sample rate to use for input & output |
channelCount | Number of channels for input & output |
error | If not NULL, the error on output |
ExtAudioFileRef _Nullable AEExtAudioFileOpen | ( | NSURL *_Nonnull | url, |
AudioStreamBasicDescription *_Nullable | outAudioDescription, | ||
UInt64 *_Nullable | outLengthInFrames, | ||
NSError *_Nullable *_Nullable | error | ||
) |
Open an audio file for reading.
This utility creates a new reader instance, and returns the reader, the client format AudioStreamBasicDescription used for reading, and the total length in frames, both usually useful for operating on files.
It will be configured to use the standard AEAudioDescription format, with the channel count and sample rate determined by the file format - this configured format is returned via the outAudioDescription parameter. Use kExtAudioFileProperty_ClientDataFormat to change this if required.
url | URL to the file to read from |
outAudioDescription | On output, the AEAudioDescription-derived stream format for reading (the client format) |
outLengthInFrames | On output, the total length in frames |
error | If not NULL, the error on output |