Get List of Audio Devices

You can initiate a Stream using either the browser’s default Audio Device or by specifying the ID of the Audio Device connected to the device running the client application which requires you to get the Device IDs of all the connected devices.  

The EnxRoom.getDevices() method provides a list of all the Microphones connected to your Device. You can also use this method to build UI Element allowing users to choose an Audio Device from the list.

Class: EnxRoom

Method: -(NSArray*)getDevices;

Returns: Device list

NSArray *devicesList = [room getDevices];

// Returns [Speaker, EARPIECE, Headphones, Bluetooth] 
// Note: One or many of these devices in array as applicable

Get Selected Audio Device by User

The EnxRoom.getSelectedDevice() method provides the currently selected/in-use Audio Device for the Stream.

Class: EnxRoom

Method: -(NSString*)getSelectedDevice;

String selectedDevice =  [room getSelectedDevice]; 
// Returns one of these - Speaker, EARPIECE, Headphones, Bluetooth

Handle Audio Device Updates

The notification on any addition or modification in the Audio Devices such as earphones or headphones connected to the Mobile device is provided through the following Callbacks:

Delegate Method:

- (void)didNotifyDeviceUpdate:(NSString*)updates; – Acknowledgment to the user when a switch to alternate media devices is made at run-time.

- (void)didNotifyDeviceUpdate:(NSString*)updates  {
  // Device attached or detached