Closed x3mall1986 closed 7 years ago
I have never worked with CallKit and audio (only video and data channel), so I don't know what can be a problem. You probably should ask in the discussion group.
It should be reported to the bug tracker, because it relates to code rather than build. https://bugs.chromium.org/p/webrtc/issues/list
@x3mall1986 Have you managed to find the issue? I am facing the same problem.
@bmaslakov yes, you need use configureAudioSession from apple's example source. It takes time, so you need to call this method before answer the call.
to enable audio and mic in CallKit you should configure audioSession properly, like in apple's sample app "Speakerbox". You should configure it not in accept call method of CallKit delegate, but in reportIncomingCallWithUUID.
Swift code sample
provider.reportNewIncomingCall(with: uuid, update: update) { error in if error == nil { configureAudioSession() } }
objc example
[self.callKitProvider reportNewIncomingCallWithUUID:uuid update:callUpdate completion:^(NSError *error) { if (!error) { [AudioRouter configureAudioSession]; } }];
During the Kranky Geek event there was a talk where they described audio issues with webrtc and callkit.
@multybuq Does moving configureAudioSession()
to reportNewIncomingCall
not leads to a permanent red status bar when the incoming call is a) declined or b) hung up by caller before answered? This is what I could observe in my implementation.
I have problem with red bar too. How can I hide it?
The issue seems to be in handleInterruption
(audio is started when interruption ends). What I did is I removed the observer for audio interruptions in provider(_ provider: CXProvider, perform action: CXEndCallAction)
.
If I release audioController
in provider(_ provider: CXProvider, perform action: CXEndCallAction)
with self.audioController = nil
will it give the same effect?
Hi guys, @x3mall1986 is your app Swift or Objective-C ? if Swift, do you know how can i configure audioSession in Objective-C? Tagged for notification : @multybuq , @Jeyhey , @bmaslakov :)
@invisible66 sample from Apple contains the configuration of the audioSession.
@x3mall1986 but it swift :) i need Objective-C.
@invisible66 It works well for obj-c and need only initialize AudioController
, implement and call methods:
- (void)startAudio {
if ([self.audioController startIOUnit] == kAudioServicesNoError) {
self.audioController.muteAudio = NO;
}
}
- (void)stopAudio {
if ([self.audioController stopIOUnit] != kAudioServicesNoError) {
NSLog(@"audio error");
}
}
@x3mall1986 i think i am noob :( plsease can you give me AudioController initialize code and where i put it :( thank you for answers.
Initialize in this method:
- (void)configureAudioSession {
if (!self.audioController) {
self.audioController = [[AudioController alloc] init];
}
}
and call from block:
[self.provider reportNewIncomingCallWithUUID:uuid update:update completion:^(NSError * _Nullable error) {
if (!error) {
...
[self configureAudioSession];
}
}];
@x3mall1986 I got this error.
AVAudioSession error activating: Error Domain=NSOSStatusErrorDomain Code=561017449 "(null)" 2017-03-09 18:17:48.830893 Netgsm[1620:971182] [aurioc] 892: failed: '!pri' (enable 3, outf< 1 ch, 16000 Hz, Int16> inf< 1 ch, 16000 Hz, Int16>) 2017-03-09 18:17:48.841301 Netgsm[1620:971182] [aurioc] 892: failed: '!pri' (enable 3, outf< 1 ch, 44100 Hz, Int16> inf< 1 ch, 44100 Hz, Int16>) 2017-03-09 18:17:48.850282 Netgsm[1620:971182] [aurioc] 892: failed: '!pri' (enable 3, outf< 1 ch, 48000 Hz, Int16> inf< 1 ch, 48000 Hz, Int16>) . . .
If I make a call via CallKit, the connection occurs, the video is working, but the audio does not work. If you make a second call without closing the application video and audio works fine. After restarting, the problem persists again.
In the console on the first connection this error:
If I make a call without using CallKit - everything works fine.
Are there any ideas? Thanks in advance for your answers.