Sets the bitrate.

@param int $bitrate The bitrate to set.

@return \React\Promise\Promise
540137
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();
    }
1235623
public function setDuration($duration)
    {
        // get dom element
        $durationDomElement = $this->getDomElement()->getElementsByTagName('Duration')->item(0);
        if (!$durationDomElement) {
            $durationDomElement = $this->getDomElement()->ownerDocument->createElement('Duration');
            $this->getDomElement()->firstChild->appendChild($durationDomElement);
        }

        // set value
        if (is_numeric($duration)) {
            // in seconds
            $duration = $this->secondsToString($duration);
        }

        $durationDomElement->nodeValue = $duration;

        return $this;
    }
317356
public function setCode($code)
    {
        if (null !== $code && !in_array(strtoupper($code), self::$availableCurrencies)) {
            throw new \Bitpay\Client\ArgumentException(
                sprintf('The currency code "%s" is not supported.', $code)
            );
        }

        $this->code = strtoupper($code);

        return $this;
    }
242651
public function set($element)
    {
        if (!is_scalar($element)) {
            $element = serialize($element);
        }

        $hashes = $this->hash($element);

        foreach ($hashes as $hash) {
            $offset = (int)floor($hash / 8);
            $bit = (int)($hash % 8);
            $this->filter[$offset] = chr(ord($this->filter[$offset]) | (2 ** $bit));
        }

        $this->empty = false;
    }
78659
public function write_bit($b)
    {
        $b = $b ? 1 : 0;
        $shift = $this->bitcount % 8;
        $last = $shift === 0 ? 0 : array_pop($this->bits);
        $last |= ($b << $shift);
        array_push($this->bits, $last);
        $this->bitcount += 1;

        return $this;
    }
473091
public function decodeBitwise($bitwise, $deny = 0)
    {
        $result = $this->getDefault();

        foreach ($this->bitwise as $key => $value) {
            if (true === ((($bitwise >> $value) & 1) == 1)) {
                $result[$key] = true;
            } elseif (true === ((($deny >> $value) & 1) == 1)) {
                $result[$key] = false;
            }
        }

        $this->fill($result);

        return $this;
    }
1264800
public function setFrameRate($frameRate)
	{
		if ( ! is_numeric($frameRate) || $frameRate < 0)
		{
			throw new \InvalidArgumentException('Wrong the frame rate value.');
		}
		
		$this->videoFrameRate = $frameRate;
		
		return $this;
	}
102615
public function setNumberFormat($decimals = NULL, $decPoint = NULL, $thousandsSep = NULL)
    {
        if ($decimals !== NULL) {
            $this->numberFormat[self::NUMBER_FORMAT_DECIMALS] = (int) $decimals;
        }

        if ($decPoint !== NULL) {
            $this->numberFormat[self::NUMBER_FORMAT_DECIMAL_POINT] = $decPoint;
        }

        if ($thousandsSep !== NULL) {
            $this->numberFormat[self::NUMBER_FORMAT_THOUSANDS_SEPARATOR] = $thousandsSep;
        }

        return $this;
    }
1370024
public function setPrice($price)
    {
        if (is_string($price)) {
            $this->checkPriceFormat($price);
        }

        $this->price = (float)$price;

        return $this;
    }
1322307
public function setFormat($format)
    {
        if (!is_null($format)) {
            $this->format = $format;
            $this->useFormat(false);
        }

        return $this;
    }
776327
public function setFormats($formats)
    {
        foreach ($formats as $type => $format) {
            $this->setFormat($type, $format);
        }

        return $this;
    }
501877
public function setAudioBitrate($bitrate)
	{
		if ( ! is_numeric($bitrate) || $bitrate < 0)
		{
			throw new \InvalidArgumentException('The audio bitrate value must be a integer type.');
		}
		
		$this->audioBitrate = (int) $bitrate;
		
		return $this;
	}
1014072
public function setFormat($format = null)
    {
        if ( ! is_null($format)) {
            self::checkFormat($format);
            $this->format = $format;
        }

        return $this;
    }
518671
public function setPrice($price) {
        if(!$this->setModified('price', $price)->isModified()) {
            return $this;
        }
		$this->price = $price;
		return $this;
    }
1296812
public function setFormat($format) {

        $this->checkInArray($format, GDAXConstants::$reportFormatValues);
        $this->format = $format;
        return $this;

    }
61666
public function set(string $key, $value): Promise
    {
        try {
            $file = $this->cacheDir . urlencode($key);
            if (!file_exists($this->cacheDir)) {
                mkdir($this->cacheDir);
            }
            file_put_contents($file, serialize($value));
        } finally {
            return Promise\resolve(null);
        }
    }
1268295
public function setCurrency(string $currency): self
    {
        $this->isValidCurrency($currency);

        $this->currency = $currency;

        return $this;
    }