11-07-2017 12:44 AM
Hello,
is it possible to set volume to phone.audiomanager in code ? Becaouse it is too low and I can't hear other side.
When I use headset and change audiomanager to headset volume is perfect.
iPhone is set to maximum volume. And in code AVFoundation is also set to max volume
and I also override hardware to use speaker and it dosen't work.
Regards,
Matous
Solved! Go to Solution.
02-21-2018 11:09 AM
Hi Matous,
Are you running with REM 11.6(1)_ES4 which has been tested as fixed for your initial issue?
Regards,
Rob
11-09-2017 07:02 AM
Hi Matous,
I assume your referring to the ACBAudioDeviceManager, which allows the app to select the audio output device.
Are you calling [phone.audioDeviceManager setAudioDevice:ACBAudioDeviceSpeakerphone], and finding the volume to be too low?
We don’t offer an API to set the volume, we just rely on the system volume controls.
I’m not clear on what you mean by:
Can you clarify exactly what you did?
Thanks,
Rob
11-09-2017 11:37 PM
Hi Rob,
once again I need your help .
Code to call AudioManager:
// audio manager
self.phone?.audioDeviceManager.start()
self.audioSession = AVAudioSession.sharedInstance()
var pointer:ACBAudioDevice?
// is headset plugged in
if (Common.instance.isHeadsetPluggedIn()) {
pointer = ACBAudioDevice.wiredHeadset
self.phone?.audioDeviceManager.setAudioDevice(&pointer!)
} else {
pointer = ACBAudioDevice.speakerphone
self.phone?.audioDeviceManager.setAudioDevice(&pointer!)
}
Register observer for plugged headset:
observer = NotificationCenter.default.addObserver(
self,
selector: #selector(CallController.audioRouteChangeListener(notification:)),
name: NSNotification.Name.AVAudioSessionRouteChange,
object: nil)
Observer notification function:
@objcfunc audioRouteChangeListener(notification:Notification) {
let audioRouteChangeReason = notification.userInfo![AVAudioSessionRouteChangeReasonKey] as! UInt
switch audioRouteChangeReason {
case AVAudioSessionRouteChangeReason.newDeviceAvailable.rawValue:
if (self.phone != nil) {
// set headset
var pointer = ACBAudioDevice.wiredHeadset
self.phone?.audioDeviceManager.setAudioDevice(&pointer)
}
break
case AVAudioSessionRouteChangeReason.oldDeviceUnavailable.rawValue:
if (self.phone != nil) {
// set speaker
var pointer = ACBAudioDevice.speakerphone
self.phone?.audioDeviceManager.setAudioDevice(&pointer)
// override speakerphone to be the one
try! self.audioSession?.overrideOutputAudioPort(AVAudioSessionPortOverride.speaker)
}
break
default:
// not need to be implemented
break
}
}
I use swift. It works perfectly in all other things so I assume that is no problem in using Swift. The "audioDeviceManager.audioDevices()" return array with one item.
11-13-2017 10:38 PM
Hi Matous,
Please print out the value of "audioDeviceManager.audioDevices()" when the headset is not plugged in and then when it is plugged in.
After this print out [uc.phone.audioDeviceManager selectedAudioDevice];
Rob
11-14-2017 01:09 AM
Hi Rob,
when headset is plugged in
audioDeviceManager.audioDevices() {
0,
0
}
audioDeviceManager.selectedAudioDevice(): nil
when headset is not plugged in
audioDeviceManager.audioDevices() {
0
}
audioDeviceManager.selectedAudioDevice(): nil
Matous
11-17-2017 06:10 AM
Hi Matous,
Your results don’t make much sense to me:
a) I don’t know why there would be duplicate values in ‘audioDevices()’
b) I don’t know why ‘selectedAudioDevice()’ would return nil.
I'll have to raise a bug internally.
What device and iOS version were you testing on?
Rob
11-19-2017 11:36 PM
Hi Rob,
iOS version is 11.1.1
iPhone is iPhone5s
Matous
01-29-2018 05:15 AM
Hi,
I tried patched version of ACBClientSDK for sound form the speaker.
And I have one problem.
For the first time when app is launched. The first call audio is not form the speaker. Other calls works perfectly
When in the first call headphones are plugged in and out the audio is from speaker.
But the first call audio is always from ear-speaker.
I changed the order of "setAudioDevice". And I called them all when call was connected and nothing worked.
Do you have any idea that might help ?
Regards.
Matous
02-21-2018 11:09 AM
Hi Matous,
Are you running with REM 11.6(1)_ES4 which has been tested as fixed for your initial issue?
Regards,
Rob
02-22-2018 12:09 AM
Hi Rob,
I used REM 11.6.1.10000-7-ES2 from Dec. 22, 2017 found on URL: developer.cisco.com.
Thank you. I'll try ES4
Regards,
Matous
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