public function setFrameSize($fs)
    {
        $deferred = new Deferred();

        $legal = [20, 40, 60];

        if (false === array_search($fs, $legal)) {
            $deferred->reject(new \InvalidArgumentException("{$fs} is not a valid option. Valid options are: ".trim(implode(', ', $legal), ', ')));

            return $deferred->promise();
        }

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

            return $deferred->promise();
        }

        $this->frameSize = $fs;

        $deferred->resolve();

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

        $legal = [20, 40, 60];

        if (false === array_search($fs, $legal)) {
            $deferred->reject(new \InvalidArgumentException("{$fs} is not a valid option. Valid options are: ".trim(implode(', ', $legal), ', ')));

            return $deferred->promise();
        }

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

            return $deferred->promise();
        }

        $this->frameSize = $fs;

        $deferred->resolve();

        return $deferred->promise();
    }
public function setFrameSize ( $ fs ) { $ deferred = new Deferred ( ) ; $ legal = [ 20 , 40 , 60 ] ; if ( false === array_search ( $ fs , $ legal ) ) { $ deferred -> reject ( new \ InvalidArgumentException ( "{$fs} is not a valid option. Valid options are: " . trim ( implode ( ', ' , $ legal ) , ', ' ) ) ) ; return $ deferred -> promise ( ) ; } if ( $ this -> speaking ) { $ deferred -> reject ( new \ Exception ( 'Cannot change frame size while playing.' ) ) ; return $ deferred -> promise ( ) ; } $ this -> frameSize = $ fs ; $ deferred -> resolve ( ) ; return $ deferred -> promise ( ) ; }
Sets the frame size.

Options (in ms):
- 20
- 40
- 60

@param int $fs The frame size to set.

@return \React\Promise\Promise
Sets the frame size .