consumeMicStreams

open suspend fun consumeMicStreams()

Subscribes this device to the participant's microphone: the way to receive it in a room joined with createRoom(autoConsume = false), and to receive it again after stopConsumingMicStreams.

Takes effect only when the room was created with autoConsume = false.

Receive-side only. Unlike enableMic it asks nothing of them — they were publishing the whole time; this device had stopped listening.

Called while Room.join is still running — as it is from RoomEventListener.onParticipantJoined for the people already in the room — it waits for the join to finish. Otherwise it requires a joined room: code 3035 (ERROR_ACTION_PERFORMED_BEFORE_ROOM_JOINED) or 3065 (ERROR_ROOM_RECONNECTING) goes to onError and the call returns.

Events:

Code Example:

override fun onParticipantJoined(participant: Participant) {
lifecycleScope.launch { participant.consumeMicStreams() }
}

See also