<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/wrappers.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'wrappers.audio.php',
    1 => 'ogg://',
    2 => 'Audio streams',
  ),
  'up' => 
  array (
    0 => 'wrappers.php',
    1 => 'Supported Protocols and Wrappers',
  ),
  'prev' => 
  array (
    0 => 'wrappers.rar.php',
    1 => 'rar://',
  ),
  'next' => 
  array (
    0 => 'wrappers.expect.php',
    1 => 'expect://',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'language/wrappers/audio.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="wrappers.audio" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ogg://</h1>
  <p class="refpurpose"><span class="refname">ogg://</span> &mdash; <span class="dc-title">Audio streams</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-wrappers.audio-description">
  <h3 class="title">Description</h3>
  <p class="para">
   Files opened for reading via the <var class="filename">ogg://</var> wrapper
   are treated as compressed audio encoded using the <code class="literal">OGG/Vorbis</code> codec.
   Similarly, files opened for writing or appending via the
   <var class="filename">ogg://</var> wrapper are written as compressed audio data.
   <span class="function"><a href="function.stream-get-meta-data.php" class="function">stream_get_meta_data()</a></span>, when used on an <code class="literal">OGG/Vorbis</code>
   file opened for reading will return various details about the stream
   including the <code class="parameter">vendor</code> tag, any included
   <code class="parameter">comments</code>, the number of
   <code class="parameter">channels</code>, the sampling <code class="parameter">rate</code>,
   and the encoding rate range described by:
   <code class="parameter">bitrate_lower</code>, <code class="parameter">bitrate_upper</code>,
   <code class="parameter">bitrate_nominal</code>, and <code class="parameter">bitrate_window</code>.
  </p>

  <p class="simpara"><var class="filename">ogg://</var> (PECL)</p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <strong>This wrapper is not enabled by default</strong><br />
   <span class="simpara">
    In order to use the <var class="filename">ogg://</var> wrapper,
    the
    <a href="https://pecl.php.net/package/oggvorbis" class="link external">&raquo;&nbsp;OGG/Vorbis</a>
    extension available from <a href="https://pecl.php.net/" class="link external">&raquo;&nbsp;PECL</a> must be installed.
   </span>
  </p></blockquote>
 </div>


 <div class="refsect1 usage" id="refsect1-wrappers.audio-usage"> 
  <h3 class="title">Usage</h3>
  <ul class="itemizedlist">
   <li class="listitem"><span class="simpara"><var class="filename">ogg://soundfile.ogg</var></span></li>
   <li class="listitem"><span class="simpara"><var class="filename">ogg:///path/to/soundfile.ogg</var></span></li>
   <li class="listitem"><span class="simpara"><var class="filename">ogg://http://www.example.com/path/to/soundstream.ogg</var></span></li>
  </ul>
 </div>
 

 <div class="refsect1 options" id="refsect1-wrappers.audio-options">
  <h3 class="title">Options</h3>
  <p class="para">
   <table class="doctable table">
    <caption><strong>Wrapper Summary</strong></caption>
    
     <thead>
      <tr>
       <th>Attribute</th>
       <th>Supported</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>Restricted by <a href="filesystem.configuration.php#ini.allow-url-fopen" class="link">allow_url_fopen</a></td>
       <td>No</td>
      </tr>

      <tr>
       <td>Allows Reading</td>
       <td>Yes</td>
      </tr>

      <tr>
       <td>Allows Writing</td>
       <td>Yes</td>
      </tr>

      <tr>
       <td>Allows Appending</td>
       <td>Yes</td>
      </tr>

      <tr>
       <td>Allows Simultaneous Reading and Writing</td>
       <td>No</td>
      </tr>

      <tr>
       <td>Supports <span class="function"><a href="function.stat.php" class="function">stat()</a></span></td>
       <td>No</td>
      </tr>

      <tr>
       <td>Supports <span class="function"><a href="function.unlink.php" class="function">unlink()</a></span></td>
       <td>No</td>
      </tr>

      <tr>
       <td>Supports <span class="function"><a href="function.rename.php" class="function">rename()</a></span></td>
       <td>No</td>
      </tr>

      <tr>
       <td>Supports <span class="function"><a href="function.mkdir.php" class="function">mkdir()</a></span></td>
       <td>No</td>
      </tr>

      <tr>
       <td>Supports <span class="function"><a href="function.rmdir.php" class="function">rmdir()</a></span></td>
       <td>No</td>
      </tr>

     </tbody>
    
   </table>

  </p>
  
  <p class="para">
   <table class="doctable table">
    <caption><strong>Context options</strong></caption>
    
     <thead>
      <tr>
       <th>Name</th>
       <th>Usage</th>
       <th>Default</th>
       <th>Mode</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td><code class="literal">pcm_mode</code></td>
       <td>
        PCM encoding to apply while reading, one of:
        <strong><code>OGGVORBIS_PCM_U8</code></strong>, <strong><code>OGGVORBIS_PCM_S8</code></strong>,
        <strong><code>OGGVORBIS_PCM_U16_BE</code></strong>, <strong><code>OGGVORBIS_PCM_S16_BE</code></strong>,
        <strong><code>OGGVORBIS_PCM_U16_LE</code></strong>, and <strong><code>OGGVORBIS_PCM_S16_LE</code></strong>.
        (8 vs 16 bit, signed or unsigned, big or little <code class="literal">endian</code>)
       </td>
       <td>OGGVORBIS_PCM_S16_LE</td>
       <td>Read</td>
      </tr>

      <tr>
       <td><code class="literal">rate</code></td>
       <td>
        Sampling rate of input data, expressed in Hz
       </td>
       <td>44100</td>
       <td>Write/Append</td>
      </tr>

      <tr>
       <td><code class="literal">bitrate</code></td>
       <td>
        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)
       </td>
       <td>128000</td>
       <td>Write/Append</td>
      </tr>

      <tr>
       <td><code class="literal">channels</code></td>
       <td>
        The number of audio channels to encode, typically 1 (Mono), or 2 (Stereo).
        May range as high as 16.
       </td>
       <td>2</td>
       <td>Write/Append</td>
      </tr>

      <tr>
       <td><code class="literal">comments</code></td>
       <td>
        An array of string values to encode into the track header.
       </td>
       <td class="empty">&nbsp;</td>
       <td>Write/Append</td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>
 

</div><?php manual_footer($setup); ?>