Audio file writer.
More...
#import <AEAudioFileWriter.h>
Inherits <NSObject>.
|
NSString * | path |
| The path to the file being written.
|
|
Audio file writer.
Provides an easy-to-use interface to the ExtAudioFile API, allowing asynchronous, Core Audio thread-safe writing of arbitrary audio formats.
+ (BOOL) AACEncodingAvailable |
|
|
|
- (id) initWithAudioDescription: |
|
(AudioStreamBasicDescription) |
audioDescription |
|
Initialise, with a given audio description to use.
- Parameters
-
audioDescription | The audio format of audio that will be fed to this class via the AddAudio functions. |
- (BOOL) beginWritingToFileAtPath: |
|
(NSString *) |
path |
fileType: |
|
(AudioFileTypeID) |
fileType |
error: |
|
(NSError **) |
error |
|
|
| |
Begin write operation.
This will create the output file and prepare internal structures for writing.
- Parameters
-
path | The path to the file to create |
fileType | A file type |
error | On output, if not NULL, the error if one occurred |
- Returns
- YES on success; NO on error
- (BOOL) beginWritingToFileAtPath: |
|
(NSString *) |
path |
fileType: |
|
(AudioFileTypeID) |
fileType |
bitDepth: |
|
(UInt32) |
bits |
error: |
|
(NSError **) |
error |
|
|
| |
- (BOOL) beginWritingToFileAtPath: |
|
(NSString *) |
path |
fileType: |
|
(AudioFileTypeID) |
fileType |
bitDepth: |
|
(UInt32) |
bits |
channels: |
|
(UInt32) |
channels |
error: |
|
(NSError **) |
error |
|
|
| |
Complete writing operation.
Finishes write, closes the file and cleans up internal resources.
- (OSStatus) AEAudioFileWriterAddAudio |
|
(AEAudioFileWriter *) |
writer |
|
|
(AudioBufferList *) |
bufferList |
|
|
(UInt32) |
lengthInFrames |
|
|
| |
Add audio to be written.
This C function, safe to be used in a Core Audio realtime thread context, is used to feed audio to this class to be written to the file.
It runs asynchronously, and will never block.
- Parameters
-
writer | A pointer to the writer object |
bufferList | An AudioBufferList containing the audio in the format you provided upon initialization |
lengthInFrames | The length of the audio in the buffer list, in frames |
- Returns
- A status code; noErr on success
- (OSStatus) AEAudioFileWriterAddAudioSynchronously |
|
(AEAudioFileWriter *) |
writer |
|
|
(AudioBufferList *) |
bufferList |
|
|
(UInt32) |
lengthInFrames |
|
|
| |
Add audio to be written, synchronously.
This C function allows you to synchronously add audio - it will block until the audio is written to the file. Note that due to the fact that it will block, this function is not to be used from a Core Audio realtime thread.
- Parameters
-
writer | A pointer to the writer object |
bufferList | An AudioBufferList containing the audio in the format you provided upon initialization |
lengthInFrames | The length of the audio in the buffer list, in frames |
- Returns
- A status code; noErr on success
The path to the file being written.
The documentation for this class was generated from the following file: