본문으로 건너뛰기
Version: 6.2

음 소거 상태 공유 및 제어

음 소거란 마이크로 입력된 오디오의 전송을 비활성화하는 것을 말합니다. 로컬 오디오를 음 소거하거나 음 소거 해제하고 애플리케이션의 음 소거 상태를 피어와 공유할 수 있습니다. 또한 특정 피어 또는 모든 피어에게 음 소거하거나 음 소거 해제하도록 요청할 수도 있습니다.

Note

PlanetKit 6.0 이전에는 음 소거 제어가 마이크의 작동에는 직접적인 영향을 미치지 않았습니다. 하지만 PlanetKit 6.0부터 음 소거 제어가 다음과 같이 마이크를 제어합니다.

  • 로컬 오디오를 음 소거하면 PlanetKit이 마이크를 끄고 오디오 전송을 비활성화하여 마이크 표시기(microphone indicator)가 꺼집니다.
  • 로컬 오디오의 음 소거를 해제하면 PlanetKit이 마이크를 켜고 오디오 전송을 활성화하여 마이크 표시기가 켜집니다.

로컬 오디오 음 소거 제어 및 공유

통화 유형별로 로컬 오디오를 음 소거하거나 음 소거 해제하는 방법을 설명합니다.

1대1 통화

1대1 통화에서 로컬 오디오를 음 소거하거나 음 소거 해제하려면 muteMyAudio()를 사용하세요. 로컬 오디오의 음 소거 상태 변경은 onPeerMicMuted 또는 onPeerMicUnmuted를 통해 피어에게 전달됩니다.

다음 다이어그램은 1대1 통화에서 로컬 오디오를 음 소거 및 음 소거 해제하는 흐름을 보여줍니다.

1대1 통화 로컬 오디오 음 소거 시퀀스 다이어그램

관련된 샘플 코드는 다음과 같습니다.

로컬 오디오 음 소거 또는 음 소거 해제하기

// isMute: true for mute, false for unmute
fun muteMyAudioExample(call: PlanetKitCall, isMute: Boolean) {
call.muteMyAudio(isMute) { result ->
Log.d(TAG, "muteMyAudio(isMute=$isMute) result: ${result.isSuccessful}")
}
}

피어 측에서 관련 이벤트 처리하기

// Implement related callbacks of the CallListener interface
// MakeCallListener for caller and AcceptCallListener for callee
private val makeAcceptCallListener = object : MakeCallListener, AcceptCallListener {
...

override fun onPeerMicMuted(call: PlanetKitCall) {
// This is called when the peer changed their microphone status to be muted.
// Write your own code here.
}

override fun onPeerMicUnmuted(call: PlanetKitCall) {
// This is called when the peer changed their microphone status to be unmuted.
// Write your own code here.
}
}

그룹 통화

그룹 통화에서 로컬 오디오를 음 소거하거나 음 소거 해제하려면 muteMyAudio()를 사용하세요. 로컬 오디오의 음 소거 상태 변경은 onPeersMicMuted 또는 onPeersMicUnmuted를 통해 피어에게 전달됩니다.

다음 다이어그램은 그룹 통화에서 로컬 오디오를 음 소거 및 음 소거 해제하는 흐름을 보여줍니다.

그룹 통화 로컬 오디오 음 소거 시퀀스 다이어그램

관련된 샘플 코드는 다음과 같습니다.

로컬 오디오 음 소거 또는 음 소거 해제하기

// isMute: true for mute, false for unmute
fun muteMyAudioExample(conference: PlanetKitConference, isMute: Boolean) {
conference.muteMyAudio(isMute) { result ->
Log.d(TAG, "muteMyAudio(isMute=$isMute) result: ${result.isSuccessful}")
}
}

피어 측에서 관련 이벤트 처리하기

// Implement related callbacks of the ConferenceListener interface
private val conferenceListener = object : ConferenceListener {
...

override fun onPeersMicMuted(conference: PlanetKitConference, peers: List<PlanetKitConferencePeer>) {
// This is called when one or more peers changed their microphone status to be muted.
// Write your own code here.
}

override fun onPeersMicUnmuted(conference: PlanetKitConference, peers: List<PlanetKitConferencePeer>) {
// This is called when one or more peers changed their microphone status to be unmuted.
// Write your own code here.
}
}

원격 오디오 음 소거 요청

통화 유형별로 원격 오디오의 음 소거 또는 음 소거 해제를 요청하는 방법을 설명합니다.

Note

피어가 요청을 받았을 때 오디오를 음 소거하거나 음 소거 해제해야 하는지 여부는 구현에 따라 다릅니다.

아래 예시에서는 피어가 요청에 따라 음 소거하거나 음 소거 해제한다고 가정합니다.

1대1 통화

1대1 통화에서 피어에게 음 소거 또는 음 소거 해제를 요청하려면 requestPeerMute()를 사용하세요. 이 요청은 onMuteMyAudioRequestedByPeer를 통해 피어에게 전달되며, 원격 오디오의 음 소거 상태 변경은 onPeerMicMuted 또는 onPeerMicUnmuted를 통해 로컬 사용자에게 전달됩니다.

다음 다이어그램은 1대1 통화에서 원격 오디오의 음 소거 및 음 소거 해제를 요청하는 흐름을 보여줍니다.

1대1 통화 원격 오디오 음 소거 시퀀스 다이어그램

관련된 샘플 코드는 다음과 같습니다.

원격 오디오 음 소거 또는 음 소거 해제 요청하기

// isMute: true for mute, false for unmute
fun requestPeerMuteExample(call: PlanetKitCall, isMute: Boolean) {
call.requestPeerMute(isMute) { result ->
Log.d(TAG, "requestPeerMute(isMute=$isMute) result: ${result.isSuccessful}")
}
}

피어 측에서 관련 이벤트 처리하기

private val makeAcceptCallListener = object : MakeCallListener, AcceptCallListener {
...

override fun onMuteMyAudioRequestedByPeer(call: PlanetKitCall, isMute: Boolean) {
// This is called when the peer requests the local user to mute or unmute the microphone.
call.muteMyAudio(isMute) { result ->
Log.d(TAG, "muteMyAudio(isMute=$isMute) result: ${result.isSuccessful}")
}
}
}

그룹 통화

그룹 통화에서는 특정 피어 또는 모든 피어에게 오디오를 음 소거하거나 음 소거 해제하도록 요청할 수 있습니다.

  • 특정 피어에게 음 소거 또는 음 소거 해제하도록 요청하려면 requestPeerMute()를 사용하세요.
  • 모든 피어에게 음 소거 또는 음 소거 해제하도록 요청하려면 requestPeersMute()를 사용하세요.

이 요청은 onMuteMyAudioRequestedByPeer를 통해 피어에게 전달되며, 원격 오디오의 음 소거 상태 변경은 onPeersMicMuted 또는 onPeersMicUnmuted를 통해 로컬 사용자에게 전달됩니다.

다음 다이어그램은 그룹 통화에서 원격 오디오의 음 소거 및 음 소거 해제를 요청하는 흐름을 보여줍니다.

그룹 통화 원격 오디오 음 소거 시퀀스 다이어그램

관련된 샘플 코드는 다음과 같습니다.

원격 오디오 음 소거 또는 음 소거 해제 요청하기

// Request mute for single peer
// isMute: true for mute, false for unmute
fun requestPeerMuteExample(conference: PlanetKitConference, peer: PlanetKitUser, isMute: Boolean) {
conference.requestPeerMute(peer, isMute) { result ->
Log.d(TAG, "requestPeerMute(peer=$peer, isMute=$isMute) result: ${result.isSuccessful}")
}
}

// Request mute for all peers
// isMute: true for mute, false for unmute
fun requestPeersMuteExample(conference: PlanetKitConference, isMute: Boolean) {
conference.requestPeersMute(isMute) { result ->
Log.d(TAG, "requestPeersMute(isMute=$isMute) result: ${result.isSuccessful}")
}
}

피어 측에서 관련 이벤트 처리하기

private val conferenceListener = object : ConferenceListener {
...

override fun onMuteMyAudioRequestedByPeer(conference: PlanetKitConference, peer: PlanetKitConferencePeer, isMute: Boolean) {
// This is called when a peer requests the local user to mute or unmute the microphone.
conference.muteMyAudio(isMute) { result ->
Log.d(TAG, "muteMyAudio(isMute=$isMute) result: ${result.isSuccessful}")
}
}
}

관련 API

음 소거 제어 및 상태 공유와 관련된 API는 다음과 같습니다.

1대1 통화

메서드

이벤트

그룹 통화

메서드

이벤트