Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

the amazing audio engine how to apply filters to microphone input

Im trying to make karaoke app that records the background music from file and the microphone. I also want to add filter effects to the microphone input.

i can do everything stated above using the amazing audio engine sdk but i cant figure out how to add the microphone input as a channel so i can apply filters to it (and not to the background music.)

any help would be appreciated.

my current recording code:

- (void)beginRecording {
// Init recorder
 self.recorder = [[AERecorder alloc] initWithAudioController:_audioController];
NSString *documentsFolder = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,   NSUserDomainMask, YES) 
                               objectAtIndex:0];
  NSString *filePath = [documentsFolder stringByAppendingPathComponent:@"Recording.aiff"];
// Start the recording process
NSError *error = NULL;
if ( ![_recorder beginRecordingToFileAtPath:filePath 
                                   fileType:kAudioFileAIFFType 
                                     error:&error] ) {
   // Report error
   return;
}
// 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];
}
like image 423
user513790 Avatar asked May 25 '13 18:05

user513790


People also ask

How do I add audio filters?

In the Music & Voice tab of the Options panel, click Audio Filter. In the Available filters list, select the desired audio filters and click Add.


1 Answers

You can separate your your back ground music and your mic by using different channels and then you can apply the filter to your mic channel only.

first declare a channel group in the header file

AEChannelGroupRef _group;

then simply add the player that you are using for recorded file to this group

[_audioController addChannels:@[_player] toChannelGroup:_group ];

and then add the filter to this group only

[_audioController addFilter:_reverb toChannelGroup:_group]; 
like image 72
Ahmad Karim Avatar answered Jan 03 '23 14:01

Ahmad Karim