How can I record Stereo in iOS 14 Objective C

128 Views Asked by At

How can I record Stereo in iOS 14 Objective C

here is my code I don't now how I will add AVAudioSessionPolarPatternStereo to my code I found the simple code for Swift but I need to add in my objective c code

    AVAudioSession * audioSession = [AVAudioSession sharedInstance];
    const AVAudioSessionPolarPattern AVAudioSessionPolarPatternStereo;
        
    [audioSession setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
    [audioSession setActive:YES error:nil];
    
    NSMutableDictionary* recordSetting = [[NSMutableDictionary alloc] init];
    [recordSetting setValue :[NSNumber numberWithInt:kAudioFormatMPEG4AAC] forKey:AVFormatIDKey];
    [recordSetting setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey];
    
    [recordSetting setValue:[NSNumber numberWithInt: 2] forKey:AVNumberOfChannelsKey];
        
    
0

There are 0 best solutions below