how to use TAAE for recording?

i am new in ios. i start to learn swift but i understood that swift is not good for audio processing also i don't know Objective-c yet.

this is Recording doc for TAAE.. but i don't understand :(. Anyone send me a sample for this ?

Included within the "Modules" directory is the AERecorder class, which implements the AEAudioReceiver protocol and provides simple but sophisticated audio recording.

To use AERecorder, initialize it using initWithAudioController: .

Then, when you're ready to begin recording, use beginRecordingToFileAtPath:fileType:error: , passing in the path to the file you'd like to record to, and the file type to use. Common file types include kAudioFileAIFFType, kAudioFileWAVEType, kAudioFileM4AType (using AAC audio encoding), and kAudioFileCAFType.

Finally, add the AERecorder instance as a receiver using the methods listed above.

Note that you can add the instance as a receiver of more than one source, and these will be mixed together automatically.

For example, you might have a karaoke app with a record function, and you want to record both the backing music and the microphone audio at the same time:

  • (void)beginRecording {
    // Init recorder
    self.recorder = [[AERecorder alloc] initWithAudioController:_audioController];
    NSString *documentsFolder = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)
    NSString *filePath = [documentsFolder stringByAppendingPathComponent:@Recording.aiff];
    // Start the recording process
    NSError *error = NULL;
    if ( ![_recorder beginRecordingToFileAtPath:filePath
    error:&error] ) {
    // Report error
    // Receive both audio input and audio output. Note that if you're using
    // AEPlaythroughChannel, mentioned above, you may not need to receive the input again.
    [_audioController addInputReceiver:_recorder];
    [_audioController addOutputReceiver:_recorder];
    To complete the recording, call finishRecording.

  • (void)endRecording {
    [_audioController removeInputReceiver:_recorder];
    [_audioController removeOutputReceiver:_recorder];
    [_recorder finishRecording];
    self.recorder = nil;

Sign In or Register to comment.