Package io.getstream.video.android.core
Class MicrophoneManager
-
- All Implemented Interfaces:
public final class MicrophoneManagerThe Microphone manager makes it easy to use your microphone in a call
-
-
Field Summary
Fields Modifier and Type Field Description private final StateFlow<DeviceStatus>statusprivate final StateFlow<Boolean>isEnabledprivate final StateFlow<StreamAudioDevice>selectedDeviceprivate final StateFlow<List<StreamAudioDevice>>devicesprivate final MediaManagerImplmediaManagerprivate final BooleanpreferSpeakerphoneprivate final IntegeraudioUsage
-
Constructor Summary
Constructors Constructor Description MicrophoneManager(MediaManagerImpl mediaManager, Boolean preferSpeakerphone, Integer audioUsage)
-
Method Summary
Modifier and Type Method Description final StateFlow<DeviceStatus>getStatus()The status of the audio final StateFlow<Boolean>isEnabled()Represents whether the audio is enabled final StateFlow<StreamAudioDevice>getSelectedDevice()Currently selected device final StateFlow<List<StreamAudioDevice>>getDevices()List of available devices. final MediaManagerImplgetMediaManager()final BooleangetPreferSpeakerphone()final IntegergetAudioUsage()final Unitpause(Boolean fromUser)final Unitresume(Boolean fromUser)final Unitdisable(Boolean fromUser)Disable the audio track. final UnitsetEnabled(Boolean enabled, Boolean fromUser)Enable or disable the microphone final Unitselect(StreamAudioDevice device)Select a specific device final StateFlow<List<StreamAudioDevice>>listDevices()List the devices, returns a stateflow with audio devices final Unitcleanup()final BooleancanHandleDeviceSwitch()-
-
Constructor Detail
-
MicrophoneManager
MicrophoneManager(MediaManagerImpl mediaManager, Boolean preferSpeakerphone, Integer audioUsage)
-
-
Method Detail
-
getStatus
final StateFlow<DeviceStatus> getStatus()
The status of the audio
-
getSelectedDevice
final StateFlow<StreamAudioDevice> getSelectedDevice()
Currently selected device
-
getDevices
final StateFlow<List<StreamAudioDevice>> getDevices()
List of available devices.
-
getMediaManager
final MediaManagerImpl getMediaManager()
-
getPreferSpeakerphone
final Boolean getPreferSpeakerphone()
-
getAudioUsage
final Integer getAudioUsage()
-
disable
final Unit disable(Boolean fromUser)
Disable the audio track. Audio is still captured, but not send. This allows for the "you are muted" toast to indicate you are talking while muted
-
setEnabled
final Unit setEnabled(Boolean enabled, Boolean fromUser)
Enable or disable the microphone
-
select
final Unit select(StreamAudioDevice device)
Select a specific device
-
listDevices
final StateFlow<List<StreamAudioDevice>> listDevices()
List the devices, returns a stateflow with audio devices
-
canHandleDeviceSwitch
final Boolean canHandleDeviceSwitch()
-
-
-
-