public function handleVoiceStateUpdate($data)
    {
        $removeDecoder = function ($ss) {
            $decoder = @$this->voiceDecoders[$ss->ssrc];

            if (is_null($decoder)) {
                return; // no voice decoder to remove
            }

            $decoder->close();
            unset($this->voiceDecoders[$ss->ssrc]);
            unset($this->speakingStatus[$ss->ssrc]);
        };

        $ss = $this->speakingStatus->get('user_id', $data->user_id);

        if (is_null($ss)) {
            return; // not in our channel
        }

        if ($data->channel_id == $this->channel->id) {
            return; // ignore, just a mute/deaf change
        }

        $removeDecoder($ss);
    }
public function handleVoiceStateUpdate($data)
    {
        $removeDecoder = function ($ss) {
            $decoder = @$this->voiceDecoders[$ss->ssrc];

            if (is_null($decoder)) {
                return; // no voice decoder to remove
            }

            $decoder->close();
            unset($this->voiceDecoders[$ss->ssrc]);
            unset($this->speakingStatus[$ss->ssrc]);
        };

        $ss = $this->speakingStatus->get('user_id', $data->user_id);

        if (is_null($ss)) {
            return; // not in our channel
        }

        if ($data->channel_id == $this->channel->id) {
            return; // ignore, just a mute/deaf change
        }

        $removeDecoder($ss);
    }
public function handleVoiceStateUpdate ( $ data ) { $ removeDecoder = function ( $ ss ) { $ decoder = @ $ this -> voiceDecoders [ $ ss -> ssrc ] ; if ( is_null ( $ decoder ) ) { return ; // no voice decoder to remove } $ decoder -> close ( ) ; unset ( $ this -> voiceDecoders [ $ ss -> ssrc ] ) ; unset ( $ this -> speakingStatus [ $ ss -> ssrc ] ) ; } ; $ ss = $ this -> speakingStatus -> get ( 'user_id' , $ data -> user_id ) ; if ( is_null ( $ ss ) ) { return ; // not in our channel } if ( $ data -> channel_id == $ this -> channel -> id ) { return ; // ignore, just a mute/deaf change } $ removeDecoder ( $ ss ) ; }
Handles a voice state update.

@param object $data The WebSocket data.

@return void
Handles a voice state update .