Creates an <audio> element.

@param string|array $sources Audio sources

@return string
349988
public static function audioHtml($sources)
    {
        $code = '<audio controls>';

        foreach ((array) $sources as $source) {
            $code .= self::element('source', ['src' => $source]);
        }

        return $code.'</audio>';
    }
255902
public function fromArray($options)
    {
        if (isset($options['AdMarkerSource'])) {
            Validate::isString($options['AdMarkerSource'], 'options[AdMarkerSource]');
            $this->_adMarkerSource = $options['AdMarkerSource'];
        }

        if (isset($options['IgnoreCea708ClosedCaptions'])) {
            Validate::isString($options['IgnoreCea708ClosedCaptions'], 'options[IgnoreCea708ClosedCaptions]');
            $this->_ignoreCea708ClosedCaptions = (bool) $options['IgnoreCea708ClosedCaptions'];
        }

        if (!empty($options['VideoStreams'])) {
            Validate::isArray($options['VideoStreams'], 'options[VideoStreams]');
            foreach ($options['VideoStreams'] as $videoStream) {
                $this->_videoStreams[] = VideoStream::createFromOptions($videoStream);
            }
        }

        if (!empty($options['AudioStreams'])) {
            Validate::isArray($options['AudioStreams'], 'options[AudioStreams]');
            foreach ($options['AudioStreams'] as $audioStream) {
                $this->_audioStreams[] = AudioStream::createFromOptions($audioStream);
            }
        }

        if (isset($options['SystemPreset'])) {
            Validate::isString($options['SystemPreset'], 'options[SystemPreset]');
            $this->_systemPreset = $options['SystemPreset'];
        }
    }
467738
public final static function merge(string $source, array $Values){
		return self::encode(array_merge(self::decode($source), $Values));
	}
1071683
public function source($source = null)
    {
        if (!func_num_args()) {
            return $this->_source;
        }
        $this->_source = $source;
        return $this;
    }
13961
protected function getSourceAsArray($source)
    {
        if (!is_array($source) && !($source instanceof ArrayAccess)) {
            user_error('$source passed in as invalid type', E_USER_ERROR);
        }
        
        if ($source instanceof SS_List || $source instanceof Map) {
            $source = $source->toArray();
        }
        
        return $source;
    }
103036
protected function createElement(array $options)
    {
        $options = array_merge($options, $this->getMultiplier());

        return parent::createElement($options);
    }
1348611
public static function replace_sources($tag, $sources) {
        $tag = self::remove_attributes($tag, 'src');
        $tag = preg_replace(['~</?source\b[^>]*>~i'], '', $tag);
        if (preg_match('/^(<.*?>)([^\0]*)$/ms', $tag, $matches)) {
            $tag = $matches[1].$sources.$matches[2];
        }
        return $tag;
    }
134086
public function encode($inputs)
    {
        if (is_array($inputs)) {
            $output = new Buffer;
            $result = new Buffer;

            foreach ($inputs as $input) {
                $output->concat($this->encode($input));
            }
            return $result->concat($this->encodeLength($output->length(), 192), $output);
        }
        $output = new Buffer;
        $input = $this->toBuffer($inputs);
        $length = $input->length();

        if ($length === 1 && $input[0] < 128) {
            return $input;
        } else {
            return $output->concat($this->encodeLength($length, 128), $input);
        }
    }
1120697
public function setSource($source)
    {
        $sourceAttribute = $this->sourceAttribute;
        return (is_string($sourceAttribute) && !empty($sourceAttribute)) ? $this->$sourceAttribute = $source : null;
    }
439567
protected function setTrackAttribute($items)
    {
        if ( ! is_array($items))
        {
            return $items;
        }

        return array_map(function ($item) {
            return $this->getNestedContext(MusicRecording::class, $item);
        }, $items);
    }
151712
public final static function clear(string $source, $keys): string {
		return self::encode(Arr::clear(self::decode($source),
			...array_slice(func_get_args(), 1)));
	}
903868
public function createDocumentFromSource($source)
    {
        if ($source instanceof \DOMDocument) {
            return $source;
        }

        throw new RuntimeException(RuntimeException::INVALID_DOM_SOURCE_STR, RuntimeException::INVALID_DOM_SOURCE);
    }
395159
public function concatenateSounds($sounds, $target)
    {
        if (empty($sounds)) {
            $sounds = array();
        }
        if (!is_array($sounds)) {
            $sounds = array($sounds);
        }

        $this->serviceLocator->setShared('playgroundcore_phpvideotoolkit', false);
        $ffmpeg = $this->serviceLocator->get('playgroundcore_phpvideotoolkit')
            ->addPreInputCommand('-y');

        $concat = '';
        foreach ($sounds as $k => $s) {
            $ffmpeg->addCommand('-i', $s, true);
            $concat .= '['.$k.':0]';
        }
        $concat .= 'concat=n='. count($sounds) .':v=0:a=1[out]';

        $ffmpeg->addCommand('-filter_complex', $concat)
            ->addCommand('-map', '[out]')
            ->setOutputPath($target)
            ->execute();

        return $target;
    }
1323376
protected function createResourceOutput(?array $resources) : ?string
    {
        if (empty($resources)) {
            return null;
        }

        $extra = [];

        foreach ($resources as $attr => $value) {
            $extra[] = e($attr) . '="' . e($value) . '"';
        }

        return implode(' ', $extra);
    }
266483
private function createFormat($audioFormat)
    {
        switch ($audioFormat) {
            case 'aac':
                $format = new Aac();
                break;

            case 'flac':
                $format = new Flac();
                break;

            case 'vorbis':
                $format = new Vorbis();
                break;

            case 'mp3':
            default:
                $format = new Mp3();
                break;
        }

        return $format;
    }
217846
protected function createSingle(array $source)
    {
        $data = [];
        /** @var FieldDescriptor $field */
        foreach ($this->getDescriptor()->getFields() as $field) {
            if (array_key_exists($field->getField(), $source)) {
                $data[$field->getName()] = $source[$field->getField()];
            }
        }
        $class = $this->getDescriptor()->className();
        return new $class($data);
    }
68840
public static function getDigest($sources)
    {
        $info = array();
        foreach ($sources as $source) {
            $info[] = array(
                $source->getId(), $source->getMinifier(), $source->getMinifierOptions()
            );
        }

        return md5(serialize($info));
    }