cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
2338
Views
4
Helpful
6
Replies
sberbank_ua
Beginner

iOS sdk, earphone (top speaker iphone)

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

6 REPLIES 6
robdoyle
Cisco Employee

Hi Michael,

This issue will be fixed in REM 11.5

Regards,

Rob

Hi Robert,

Thanks for the answer, and when the release of the 11.5?

Hi Micheal,

Apologises for the late reply... The last I heard was that it may be August.

Regards,

Rob

Hi Robert,

in 11.5.1.10000-22 problem is not solved

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");

    }

}

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.

Create
Recognize Your Peers
Content for Community-Ad