提问人:MidDev 提问时间:11/4/2020 更新时间:11/4/2020 访问量:120
如何在 iOS 14 Objective C 中录制立体声
How can I record Stereo in iOS 14 Objective C
问:
如何在 iOS 14 Objective C 中录制立体声
这是我的代码,我现在不知道如何将 AVAudioSessionPolarPatternStereo 添加到我的代码中 我找到了 Swift 的简单代码,但我需要添加我的目标 c 代码
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];
答: 暂无答案
评论
if (@available(iOS 14.0, *)){ [audioSession setPreferredInputOrientation:error:]; }