06-05-2016 01:26 AM
Hello,
I want to change audio route to earspeacker (top speaker ipone), when proximity changed. But call audio session still working from speaker.
Call create
ACBClientCall* call = [self.uc.phone createCallToAddress:@"dialed number" audio:YES video:NO delegate:self];
How can I do that? (I use a version of sdk rem_iOS_SDK-10.6.3.10000-3.tar.gz)
UPD
bug is very similar to 2.1.15 Fusion Client SDK
BugID 6787 "iOS audio-only call outputs audio to speakerphone, not receiver"
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
audioSession = [AVAudioSession sharedInstance];
[audioSession setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
[audioSession setActive:YES error:nil];
AVAudioSessionPortDescription *routePort = audioSession.currentRoute.outputs.firstObject;
NSString *portType = routePort.portType;
NSLog(@"PortType %@", portType);
if ([portType isEqualToString:@"Receiver"]) {
[audioSession overrideOutputAudioPort:AVAudioSessionPortOverrideSpeaker error:nil];
}
[UIDevice currentDevice].proximityMonitoringEnabled = YES;
if ([UIDevice currentDevice].proximityMonitoringEnabled == YES) {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(proximityChanged:)
name:@"UIDeviceProximityStateDidChangeNotification"
object:[UIDevice currentDevice]];
}
}
- (void) proximityChangedNSNotification *)notification {
UIDevice *device = [notification object];
NSLog(@"In proximity: %i", device.proximityState);
if(device.proximityState == 0){
[audioSession overrideOutputAudioPort:AVAudioSessionPortOverrideSpeaker error:nil];
}
else{
[audioSession overrideOutputAudioPort:AVAudioSessionPortOverrideNone error:nil];
}
}
Сообщение отредактировано: Michael Mulesa
06-08-2016 02:41 AM
Hi Michael,
This issue will be fixed in REM 11.5
Regards,
Rob
06-08-2016 02:45 AM
Hi Robert,
Thanks for the answer, and when the release of the 11.5?
06-28-2016 07:27 AM
Hi Micheal,
Apologises for the late reply... The last I heard was that it may be August.
Regards,
Rob
10-02-2016 11:12 AM
Hi Robert,
in 11.5.1.10000-22 problem is not solved
11-23-2016 07:19 AM
Hi Michael,
I'm looking into this now.... can I check your device has a proximity sensor?
- (void) activateProximitySensor {
UIDevice *device = [UIDevice currentDevice];
device.proximityMonitoringEnabled = YES;
if (device.proximityMonitoringEnabled == YES) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(proximityChanged:) name:@"UIDeviceProximityStateDidChangeNotification" object:device];
NSLog(@"proximity Monitoring on this device");
}
else{
NSLog(@"No proximity Monitoring on this device");
}
}
11-23-2016 07:29 AM
Hi Robert,
Proximity is an example of my usage.
When you call an asset you can not change the audio output.
[audioSession overrideOutputAudioPort:AVAudioSessionPortOverrideNone error:nil];
The speaker only.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide