lundi 29 juin 2015

Record video call in iOS webRTC based APP

I'm developing a webrtc based video call application in iOS. I want to record the call from the phone side through the app itself. How can I do this?

    //Create temporary URL to record to
NSString *outputPath1 = [[NSString alloc] initWithFormat:@"%@%@", NSTemporaryDirectory(), @"MyAudioRecord.mp4"];
NSURL *outputURL1 = [[NSURL alloc] initFileURLWithPath:outputPath1];

AVAudioSession *session = [AVAudioSession sharedInstance];
[session setActive:YES error:nil];
// Define the recorder setting
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];

// Initiate and prepare the recorder
recorder = [[AVAudioRecorder alloc] initWithURL:outputURL1 settings:recordSetting error:nil];
recorder.delegate = self;
recorder.meteringEnabled = YES;
[recorder prepareToRecord];

// Start recording
[recorder record];

I tried this. But its recording only the input audio. No output audio recorded.

Aucun commentaire:

Enregistrer un commentaire