AudioManagerUtility is responsible for managing Audio Input and Output devices on an Android client. Notice that some methods and events are only available on Android SDK 31 and above. Application layer should check the version of Android on the client before attempting to call such methods. Use if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) More...
Public Member Functions | |
AudioManagerUtility (Context context, AudioDevicePreferenceProfile profile) | |
AudioManagerUtility constructor Parameters: More... | |
String | serializeDevice (AudioDeviceInfo device) |
Utility method that provides a string representation of an AudioDeviceInfo. More... | |
AudioDeviceInfo[] | enumerateDevices () |
Promise< AudioDeviceInfo > | setSpeakerOn () |
Enables built-in speaker for audio communication. More... | |
Promise< AudioDeviceInfo > | setBluetoothOn () |
Enables a connected bluetooth device for audio communication. When multiple bluetooth devices are connected, a random bluetoth device will be enabled. On some modern Android systems, it is possible to enable different Bluetooth Devices by first examining their IDs via AudioManagerUtility.enumerateDevices() and then using AudioManagerUtility.setAudioCommunicationDeviceId() - only available in SDK 31 and above. More... | |
Promise< AudioDeviceInfo > | setEarpieceOn () |
Enables built-in earpiece for audio communication. Typical for audio-only conferences. More... | |
Promise< AudioDeviceInfo > | setWiredHeadsetOn () |
Enables plugged in wired headset for audio communication. May not work on some devices running SDK 30 and earlier. More... | |
void | startSession () |
Call this method when starting local or remote media. More... | |
void | endSession () |
Call this method when the last connection on a conference completes. More... | |
void | addOnDeviceAdded (IAction1< AudioDeviceInfo > value) throws UnsupportedOperationException |
Adds an event listener that is invoked when an audio device is added. Only available on Android SDK 30 and above. More... | |
void | removeOnDeviceAdded (IAction1< AudioDeviceInfo > value) |
Removes an event listener that is invoked when an audio device is added. Only available on Android SDK 30 and above. More... | |
void | addOnDeviceRemoved (IAction1< AudioDeviceInfo > value) throws UnsupportedOperationException |
Adds an event listener that is invoked when an audio device is removed. Only available on Android SDK 30 and above. More... | |
void | removeOnDeviceRemoved (IAction1< AudioDeviceInfo > value) |
Removes an event listener that is invoked when an audio device is removed. Only available on Android SDK 30 and above. More... | |
void | addOnDeviceChanged (IAction1< AudioDeviceInfo > value) throws UnsupportedOperationException |
Adds an event listener that is invoked when an active audio device used for communication has been changed. Only available on Android SDK 30 and above. More... | |
void | removeOnDeviceChanged (IAction1< AudioDeviceInfo > value) |
Removes an event listener that is invoked when an active audio device used for communication has been changed. Only available on Android SDK 30 and above. More... | |
AudioManagerUtility is responsible for managing Audio Input and Output devices on an Android client. Notice that some methods and events are only available on Android SDK 31 and above. Application layer should check the version of Android on the client before attempting to call such methods. Use if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S)
fm.liveswitch.android.AudioManagerUtility.AudioManagerUtility | ( | Context | context, |
AudioDevicePreferenceProfile | profile | ||
) |
AudioManagerUtility constructor Parameters:
void fm.liveswitch.android.AudioManagerUtility.addOnDeviceAdded | ( | IAction1< AudioDeviceInfo > | value | ) | throws UnsupportedOperationException |
Adds an event listener that is invoked when an audio device is added. Only available on Android SDK 30 and above.
void fm.liveswitch.android.AudioManagerUtility.addOnDeviceChanged | ( | IAction1< AudioDeviceInfo > | value | ) | throws UnsupportedOperationException |
Adds an event listener that is invoked when an active audio device used for communication has been changed. Only available on Android SDK 30 and above.
void fm.liveswitch.android.AudioManagerUtility.addOnDeviceRemoved | ( | IAction1< AudioDeviceInfo > | value | ) | throws UnsupportedOperationException |
Adds an event listener that is invoked when an audio device is removed. Only available on Android SDK 30 and above.
void fm.liveswitch.android.AudioManagerUtility.endSession | ( | ) |
Call this method when the last connection on a conference completes.
AudioDeviceInfo [] fm.liveswitch.android.AudioManagerUtility.enumerateDevices | ( | ) |
void fm.liveswitch.android.AudioManagerUtility.removeOnDeviceAdded | ( | IAction1< AudioDeviceInfo > | value | ) |
Removes an event listener that is invoked when an audio device is added. Only available on Android SDK 30 and above.
void fm.liveswitch.android.AudioManagerUtility.removeOnDeviceChanged | ( | IAction1< AudioDeviceInfo > | value | ) |
Removes an event listener that is invoked when an active audio device used for communication has been changed. Only available on Android SDK 30 and above.
void fm.liveswitch.android.AudioManagerUtility.removeOnDeviceRemoved | ( | IAction1< AudioDeviceInfo > | value | ) |
Removes an event listener that is invoked when an audio device is removed. Only available on Android SDK 30 and above.
String fm.liveswitch.android.AudioManagerUtility.serializeDevice | ( | AudioDeviceInfo | device | ) |
Utility method that provides a string representation of an AudioDeviceInfo.
Promise<AudioDeviceInfo> fm.liveswitch.android.AudioManagerUtility.setBluetoothOn | ( | ) |
Enables a connected bluetooth device for audio communication. When multiple bluetooth devices are connected, a random bluetoth device will be enabled. On some modern Android systems, it is possible to enable different Bluetooth Devices by first examining their IDs via AudioManagerUtility.enumerateDevices() and then using AudioManagerUtility.setAudioCommunicationDeviceId() - only available in SDK 31 and above.
Promise<AudioDeviceInfo> fm.liveswitch.android.AudioManagerUtility.setEarpieceOn | ( | ) |
Enables built-in earpiece for audio communication. Typical for audio-only conferences.
Promise<AudioDeviceInfo> fm.liveswitch.android.AudioManagerUtility.setSpeakerOn | ( | ) |
Enables built-in speaker for audio communication.
Promise<AudioDeviceInfo> fm.liveswitch.android.AudioManagerUtility.setWiredHeadsetOn | ( | ) |
Enables plugged in wired headset for audio communication. May not work on some devices running SDK 30 and earlier.
void fm.liveswitch.android.AudioManagerUtility.startSession | ( | ) |
Call this method when starting local or remote media.