public function setBitrate($bitrate)
    {
        $deferred = new Deferred();

        if ($bitrate > 128000 || $bitrate < 8000) {
            $deferred->reject(new \InvalidArgumentException("{$bitrate} is not a valid option. The bitrate must be between 8,000bpm and 128,000bpm."));

            return $deferred->promise();
        }

        if ($this->speaking) {
            $deferred->reject(new \Exception('Cannot change bitrate while playing.'));

            return $deferred->promise();
        }

        $this->bitrate = $bitrate;

        $deferred->resolve();

        return $deferred->promise();
    }
public function setBitrate($bitrate)
    {
        $deferred = new Deferred();

        if ($bitrate > 128000 || $bitrate < 8000) {
            $deferred->reject(new \InvalidArgumentException("{$bitrate} is not a valid option. The bitrate must be between 8,000bpm and 128,000bpm."));

            return $deferred->promise();
        }

        if ($this->speaking) {
            $deferred->reject(new \Exception('Cannot change bitrate while playing.'));

            return $deferred->promise();
        }

        $this->bitrate = $bitrate;

        $deferred->resolve();

        return $deferred->promise();
    }
public function setBitrate ( $ bitrate ) { $ deferred = new Deferred ( ) ; if ( $ bitrate > 128000 || $ bitrate < 8000 ) { $ deferred -> reject ( new \ InvalidArgumentException ( "{$bitrate} is not a valid option. The bitrate must be between 8,000bpm and 128,000bpm." ) ) ; return $ deferred -> promise ( ) ; } if ( $ this -> speaking ) { $ deferred -> reject ( new \ Exception ( 'Cannot change bitrate while playing.' ) ) ; return $ deferred -> promise ( ) ; } $ this -> bitrate = $ bitrate ; $ deferred -> resolve ( ) ; return $ deferred -> promise ( ) ; }
Sets the bitrate.

@param int $bitrate The bitrate to set.

@return \React\Promise\Promise
Sets the bitrate .