Author Message
prashant06
Joined: Aug 8, 2017
Messages: 32
Offline
How i can set speaker ON default in sample app. It is initially speaker is OFF and when we toggle button then speaker gets ON.
Can you please suggest me how I can set speaker ON default.
Pavel_K
Joined: Dec 20, 2016
Messages: 67
Offline
You can set any audio device when you want. To get all available devices you can check "printSpeakersList" sample app method. To set one of them - use "setSpeaker" sample app method.
For example, you can save guid of speaker in config file and use it to find the device and set it, during initialization.

For sample app, you can add this code during initialization:


for (CSSpeakerDevice *speaker in [[self.mediaManager audioInterface] availableAudioDevices]) {

if ([speaker.name isEqualToString:@"AudioDeviceSpeaker"]) {

[self.mediaManager setSpeaker:speaker];
break;
}
}
prashant06
Joined: Aug 8, 2017
Messages: 32
Offline
Thanks :)
Go to:   
Mobile view