How to remove background noise while recording a audio sessions?

761 views Asked by At

I am Using AVAudioRecorder for Recording human voice and after that need to change pitch for applying some effects.For this i am using AVAudioPlayerNode.But it also records background noise .I searched alot but I couldn't found a perfect solutions.below is the code how I am recording that audio.I found some where that we need to do DSP(Digital Signature process) for this.

recordSetting = [[NSMutableDictionary alloc] init];
    [recordSetting setValue :[NSNumber numberWithInt:kAudioFormatLinearPCM] forKey:AVFormatIDKey];
    [recordSetting setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey];
    [recordSetting setValue:[NSNumber numberWithInt: 1] forKey:AVNumberOfChannelsKey];
    [recordSetting setValue:[NSNumber numberWithInt:16] forKey:AVLinearPCMBitDepthKey];
    [recordSetting setValue:[NSNumber numberWithBool:NO] forKey:AVLinearPCMIsBigEndianKey];
    [recordSetting setValue:[NSNumber numberWithBool:NO] forKey:AVLinearPCMIsFloatKey];
    [recordSetting setValue:[NSNumber numberWithInt: AVAudioQualityHigh]forKey:AVEncoderAudioQualityKey];
    
    NSArray* documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString* fullFilePath = [[documentPaths objectAtIndex:0] stringByAppendingPathComponent: @"in.caf"];
    inUrl = [NSURL fileURLWithPath:fullFilePath];
    voiceRecorder = [[ AVAudioRecorder alloc] initWithURL: inUrl settings:recordSetting error:&error];
    //[audioRecorder setMeteringEnabled:YES];
    [voiceRecorder setDelegate: self];
    [voiceRecorder prepareToRecord];

can someone please help me in removing background noises so that I can get clear recording.

0

There are 0 answers