how can i use with swift?

AEAudioUnitInputModule * input = [AEAudioUnitInputModule new];
AEDelayModule * delay = [AEDelayModule new];
AEAudioFilePlayerModule * player = [[AEAudioFilePlayerModule alloc] initWithPath:backgroundMusic];
AEAudioFileRecorderModule * recorder = [[AEAudioFileRecorderModule alloc] initWithPath:savePath];

self.output = [[AEAudioUnitOutput alloc] initWithBlock:^(const AERenderContext * _Nonnull context) {
// Pushes a buffer on the stack (containing the input audio)
AEModuleProcess(input, context);

// Modifies the top buffer in place (apply delay effect)
AEModuleProcess(delay, context);

// Pushes a second buffer (containing playback audio)
AEModuleProcess(player, context);

// Mixes the buffers (input + playback = karaoke funtimes)
AEBufferStackMix(context, 2);

// Processes the top buffer in place (record it to file)
AEModuleProcess(recorder, context);

// Sends the top 1 buffer(s) to the output starting at output channel 0
AERendererMixOutput(context, 1, 0);

}];

Sign In or Register to comment.