Document ogg/vorbis

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@167863 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Sara Golemon 2004-09-02 17:31:41 +00:00
parent 2fd32205b8
commit 40ca789c25

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.41 $ -->
<!-- $Revision: 1.42 $ -->
<appendix id="wrappers">
<title>List of Supported Protocols/Wrappers</title>
<para>
@ -760,6 +760,160 @@ file_set_contents("php://filter/write=string.rot13/resource=example.txt","Hello
</table>
</para>
</section>
<section id="wrappers.audio">
<title>Audio Streams</title>
<simpara><filename>ogg://</filename> PHP 4.3.0 and up (PECL) </simpara>
<itemizedlist>
<listitem><simpara><filename>ogg://soundfile.ogg</filename></simpara></listitem>
<listitem><simpara><filename>ogg:///path/to/soundfile.ogg</filename></simpara></listitem>
<listitem><simpara><filename>ogg://http://www.example.com/path/to/soundstream.ogg</filename></simpara></listitem>
</itemizedlist>
<note>
<title>This wrapper is not enabled by default</title>
<simpara>
In order to use the <filename>ogg://</filename> wrapper you must install
the <ulink url="&url.pecl.package;oggvorbis">OGG/Vorbis</ulink> extension
available from <ulink url="&url.pecl;">PECL</ulink>.
</simpara>
</note>
<simpara>
Files opened for reading via the <filename>ogg://</filename> wrapper
are treated as compressed audio encoded using the OGG/Vorbis codec.
Similarly, files opened for writing or appending via the
<filename>ogg://</filename> wrapper are writen as compressed audio data.
<function>stream_get_meta_data</function>, when used on an OGG/Vorbis
file opened for reading will return various details about the stream
including the <parameter>vendor</parameter> tag, any included
<parameter>comments</parameter>, the number of
<parameter>channels</parameter>, the sampling <parameter>rate</parameter>,
and the encoding rate range described by:
<parameter>bitrate_lower</parameter>, <parameter>bitrate_upper</parameter>,
<parameter>bitrate_nominal</parameter>, and <parameter>bitrate_window</parameter>.
</simpara>
<para>
<table>
<title>Wrapper Summary</title>
<tgroup cols="2">
<thead>
<row>
<entry>Attribute</entry>
<entry>Supported</entry>
</row>
</thead>
<tbody>
<row>
<entry>Restricted by <link linkend="ini.allow-url-fopen">allow_url_fopen</link>.</entry>
<entry>No</entry>
</row>
<row>
<entry>Allows Reading</entry>
<entry>Yes</entry>
</row>
<row>
<entry>Allows Writing</entry>
<entry>Yes</entry>
</row>
<row>
<entry>Allows Appending</entry>
<entry>Yes</entry>
</row>
<row>
<entry>Allows Simultaneous Reading and Writing</entry>
<entry>No</entry>
</row>
<row>
<entry>Supports <function>stat</function></entry>
<entry>No</entry>
</row>
<row>
<entry>Supports <function>unlink</function></entry>
<entry>No</entry>
</row>
<row>
<entry>Supports <function>rename</function></entry>
<entry>No</entry>
</row>
<row>
<entry>Supports <function>mkdir</function></entry>
<entry>No</entry>
</row>
<row>
<entry>Supports <function>rmdir</function></entry>
<entry>No</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
<para>
<table>
<title>Context options</title>
<tgroup cols="3">
<thead>
<row>
<entry>Name</entry>
<entry>Usage</entry>
<entry>Default</entry>
<entry>Mode</entry>
</row>
</thead>
<tbody>
<row>
<entry><literal>pcm_mode</literal></entry>
<entry>
PCM encoding to apply while reading, one of:
<constant>OGGVORBIS_PCM_U8</constant>, <constant>OGGVORBIS_PCM_S8</constant>,
<constant>OGGVORBIS_PCM_U16_BE</constant>, <constant>OGGVORBIS_PCM_S16_BE</constant>,
<constant>OGGVORBIS_PCM_U16_LE</constant>, and <constant>OGGVORBIS_PCM_S16_LE</constant>.
(8 vs 16 bit, signed or unsigned, big or little endian)
</entry>
<entry>OGGVORBIS_PCM_S16_LE</entry>
<entry>Read</entry>
</row>
<row>
<entry><literal>rate</literal></entry>
<entry>
Sampling rate of input data, expressed in Hz
</entry>
<entry>44100</entry>
<entry>Write/Append</entry>
</row>
<row>
<entry><literal>bitrate</literal></entry>
<entry>
When given as an integer, the fixed bitrate at which to encode. (16000 to 131072)
When given as a float, the variable bitrate quality to use. (-1.0 to 1.0)
</entry>
<entry>128000</entry>
<entry>Write/Append</entry>
</row>
<row>
<entry><literal>channels</literal></entry>
<entry>
The number of audio channels to encode, typically 1 (Mono), or 2 (Stero).
May range as high as 16.
</entry>
<entry>2</entry>
<entry>Write/Append</entry>
</row>
<row>
<entry><literal>comments</literal></entry>
<entry>
An array of string values to encode into the track header.
</entry>
<entry/>
<entry>Write/Append</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
</section>
</appendix>
<!-- Keep this comment at the end of the file