public function setAudioApplication($app)
    {
        $deferred = new Deferred();

        $legal = ['voip', 'audio', 'lowdelay'];

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

            return $deferred->promise();
        }

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

            return $deferred->promise();
        }

        $this->audioApplication = $app;

        $deferred->resolve();

        return $deferred->promise();
    }