File_Ogg
[ class tree: File_Ogg ] [ index: File_Ogg ] [ all elements ]

Source for file Vorbis.php

Documentation is available at Vorbis.php

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4: */
  3. // +----------------------------------------------------------------------------+
  4. // | File_Ogg PEAR Package for Accessing Ogg Bitstreams                         |
  5. // | Copyright (c) 2005-2007                                                    |
  6. // | David Grant <david@grant.org.uk>                                           |
  7. // | Tim Starling <tstarling@wikimedia.org>                                     |
  8. // +----------------------------------------------------------------------------+
  9. // | This library is free software; you can redistribute it and/or              |
  10. // | modify it under the terms of the GNU Lesser General Public                 |
  11. // | License as published by the Free Software Foundation; either               |
  12. // | version 2.1 of the License, or (at your option) any later version.         |
  13. // |                                                                            |
  14. // | This library is distributed in the hope that it will be useful,            |
  15. // | but WITHOUT ANY WARRANTY; without even the implied warranty of             |
  16. // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU          |
  17. // | Lesser General Public License for more details.                            |
  18. // |                                                                            |
  19. // | You should have received a copy of the GNU Lesser General Public           |
  20. // | License along with this library; if not, write to the Free Software        |
  21. // | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA |
  22. // +----------------------------------------------------------------------------+
  23.  
  24. require_once('File/Ogg/Bitstream.php');
  25.  
  26. /**
  27.  * Check number for the first header in a Vorbis stream.
  28.  * 
  29.  * @access  private
  30.  */
  31. define("OGG_VORBIS_IDENTIFICATION_HEADER",  1);
  32. /**
  33.  * Check number for the second header in a Vorbis stream.
  34.  * 
  35.  * @access  private
  36.  */
  37. define("OGG_VORBIS_COMMENTS_HEADER",        3);
  38. /**
  39.  * Check number for the third header in a Vorbis stream.
  40.  * 
  41.  * @access  private
  42.  */
  43. define("OGG_VORBIS_SETUP_HEADER",           5);
  44. /**
  45.  * Error thrown if the stream appears to be corrupted.
  46.  * 
  47.  * @access  private
  48.  */
  49. define("OGG_VORBIS_ERROR_UNDECODABLE",      OGG_ERROR_UNDECODABLE);
  50. /**
  51.  * Error thrown if the user attempts to extract a comment using a comment key
  52.  * that does not exist.
  53.  * 
  54.  * @access  private
  55.  */
  56. define("OGG_VORBIS_ERROR_INVALID_COMMENT",  2);
  57.  
  58. define("OGG_VORBIS_IDENTIFICATION_PAGE_OFFSET"0);
  59. define("OGG_VORBIS_COMMENTS_PAGE_OFFSET",       1);
  60.  
  61. /**
  62.  * Error thrown if the user attempts to write a comment containing an illegal
  63.  * character
  64.  * 
  65.  * @access  private
  66.  */
  67. define("OGG_VORBIS_ERROR_ILLEGAL_COMMENT",  3);
  68.  
  69. /**
  70.  * Extract the contents of a Vorbis logical stream.
  71.  *
  72.  * This class provides an interface to a Vorbis logical stream found within
  73.  * a Ogg stream.  A variety of information may be extracted, including comment
  74.  * tags, running time, and bitrate.  For more information, please see the following
  75.  * links.
  76.  *
  77.  * @author      David Grant <david@grant.org.uk>, Tim Starling <tstarling@wikimedia.org>
  78.  * @category    File
  79.  * @copyright   David Grant <david@grant.org.uk>, Tim Starling <tstarling@wikimedia.org>
  80.  * @license     http://www.gnu.org/copyleft/lesser.html GNU LGPL
  81.  * @link        http://pear.php.net/package/File_Ogg
  82.  * @link        http://www.xiph.org/vorbis/doc/
  83.  * @package     File_Ogg
  84.  * @version     CVS: $Id: Vorbis.php,v 1.14 2008/01/31 04:41:44 tstarling Exp $
  85.  */
  86. {
  87.  
  88.     /**
  89.      * Version of vorbis specification used.
  90.      *
  91.      * @access  private
  92.      * @var     int 
  93.      */
  94.     var $_version;
  95.  
  96.     /**
  97.      * Number of channels in the vorbis stream.
  98.      *
  99.      * @access  private
  100.      * @var     int 
  101.      */
  102.     var $_channels;
  103.  
  104.     /**
  105.      * Number of samples per second in the vorbis stream.
  106.      *
  107.      * @access  private
  108.      * @var     int 
  109.      */
  110.     var $_sampleRate;
  111.  
  112.     /**
  113.      * Minimum bitrate for the vorbis stream.
  114.      *
  115.      * @access  private
  116.      * @var     int 
  117.      */
  118.     var $_minBitrate;
  119.  
  120.     /**
  121.      * Maximum bitrate for the vorbis stream.
  122.      *
  123.      * @access  private
  124.      * @var     int 
  125.      */
  126.     var $_maxBitrate;
  127.  
  128.     /**
  129.      * Nominal bitrate for the vorbis stream.
  130.      *
  131.      * @access  private
  132.      * @var     int 
  133.      */
  134.     var $_nomBitrate;
  135.  
  136.     /**
  137.      * Average bitrate for the vorbis stream.
  138.      *
  139.      * @access  private
  140.      * @var     float 
  141.      */
  142.     var $_avgBitrate;
  143.  
  144.     /**
  145.      * The length of this stream in seconds.
  146.      *
  147.      * @access  private
  148.      * @var     int 
  149.      */
  150.     var $_streamLength;
  151.     
  152.  
  153.     /**
  154.      * Constructor for accessing a Vorbis logical stream.
  155.      *
  156.      * This method is the constructor for the native-PHP interface to a Vorbis logical
  157.      * stream, embedded within an Ogg physical stream.
  158.      *
  159.      * @param   int     $streamSerial   Serial number of the logical stream.
  160.      * @param   array   $streamData     Data for the requested logical stream.
  161.      * @param   string  $filePath       Location of a file on the filesystem.
  162.      * @param   pointer $filePointer    File pointer for the current physical stream.
  163.      * @access  private
  164.      */
  165.     function File_Ogg_Vorbis($streamSerial$streamData$filePointer)
  166.     {
  167.         File_Ogg_Bitstream::File_Ogg_Bitstream($streamSerial$streamData$filePointer);
  168.         $this->_decodeIdentificationHeader();
  169.         $this->_decodeCommentsHeader(OGG_VORBIS_COMMENTS_HEADEROGG_VORBIS_COMMENTS_PAGE_OFFSET);
  170.         $this->_streamLength    
  171.             (( '0x' substr$this->_lastGranulePos0) ) pow(232
  172.             + '0x' substr$this->_lastGranulePos8) ))
  173.             / $this->_idHeader['audio_sample_rate'];
  174.         $this->_avgBitrate      $this->_streamLength ($this->_streamSize * 8$this->_streamLength : 0;
  175.     }
  176.  
  177.     /**
  178.      * Get a short string describing the type of the stream
  179.      */
  180.     function getType(
  181.     {
  182.         return 'Vorbis'
  183.     }
  184.  
  185.     /**
  186.      * Parse the identification header (the first of three headers) in a Vorbis stream.
  187.      *
  188.      * This function parses the identification header.  The identification header
  189.      * contains simple audio characteristics, such as sample rate and number of
  190.      * channels.  There are a number of error-checking provisions laid down in the Vorbis
  191.      * specification to ensure the stream is pure.
  192.      *
  193.      * @access  private
  194.      */
  195.     function _decodeIdentificationHeader()
  196.     {
  197.         $this->_decodeCommonHeader(OGG_VORBIS_IDENTIFICATION_HEADEROGG_VORBIS_IDENTIFICATION_PAGE_OFFSET);
  198.  
  199.         $h File_Ogg::_readLittleEndian($this->_filePointerarray(
  200.             'vorbis_version'        => 32,
  201.             'audio_channels'        => 8,
  202.             'audio_sample_rate'     => 32,
  203.             'bitrate_maximum'       => 32,
  204.             'bitrate_nominal'       => 32,
  205.             'bitrate_minimum'       => 32,
  206.             'blocksize_0'           => 4,
  207.             'blocksize_1'           => 4,
  208.             'framing_flag'          => 1
  209.         ));
  210.  
  211.         // The Vorbis stream version must be 0.
  212.         if ($h['vorbis_version'== 0)
  213.             $this->_version $h['vorbis_version'];
  214.         else
  215.             throw new PEAR_Exception("Stream is undecodable due to an invalid vorbis stream version."OGG_VORBIS_ERROR_UNDECODABLE);
  216.     
  217.         // The number of channels MUST be greater than 0.
  218.         if ($h['audio_channels'== 0)
  219.             throw new PEAR_Exception("Stream is undecodable due to zero channels."OGG_VORBIS_ERROR_UNDECODABLE);
  220.         else
  221.             $this->_channels $h['audio_channels'];
  222.     
  223.         // The sample rate MUST be greater than 0.
  224.         if ($h['audio_sample_rate'== 0)
  225.             throw new PEAR_Exception("Stream is undecodable due to a zero sample rate."OGG_VORBIS_ERROR_UNDECODABLE);
  226.         else
  227.             $this->_sampleRate $h['audio_sample_rate'];
  228.     
  229.         // Extract the various bitrates
  230.         $this->_maxBitrate  $h['bitrate_maximum'];
  231.         $this->_nomBitrate  $h['bitrate_nominal'];
  232.         $this->_minBitrate  $h['bitrate_minimum'];
  233.     
  234.         // Powers of two between 6 and 13 inclusive.
  235.         $valid_block_sizes = array(641282565121024204840968192);
  236.     
  237.         // blocksize_0 MUST be a valid blocksize.
  238.         $blocksize_0 pow(2$h['blocksize_0']);
  239.         if (FALSE == in_array($blocksize_0$valid_block_sizes))
  240.             throw new PEAR_Exception("Stream is undecodable because blocksize_0 is $blocksize_0, which is not a valid size."OGG_VORBIS_ERROR_UNDECODABLE);
  241.     
  242.         // Extract bits 5 to 8 from the character data.
  243.         // blocksize_1 MUST be a valid blocksize.
  244.         $blocksize_1 pow(2$h['blocksize_1']);
  245.         if (FALSE == in_array($blocksize_1$valid_block_sizes))
  246.             throw new PEAR_Exception("Stream is undecodable because blocksize_1 is not a valid size."OGG_VORBIS_ERROR_UNDECODABLE);
  247.     
  248.         // blocksize 0 MUST be less than or equal to blocksize 1.
  249.         if ($blocksize_0 $blocksize_1)
  250.             throw new PEAR_Exception("Stream is undecodable because blocksize_0 is not less than or equal to blocksize_1."OGG_VORBIS_ERROR_UNDECODABLE);
  251.     
  252.         // The framing bit MUST be set to mark the end of the identification header.
  253.         // Some encoders are broken though -- TS
  254.         /*
  255.         if ($h['framing_flag'] == 0)
  256.             throw new PEAR_Exception("Stream in undecodable because the framing bit is not non-zero.", OGG_VORBIS_ERROR_UNDECODABLE);
  257.          */
  258.  
  259.         $this->_idHeader $h;
  260.     }
  261.  
  262.     /**
  263.      * Decode the comments header
  264.      * @access  private
  265.      * @param   int     $packetType 
  266.      * @param   int     $pageOffset 
  267.      */
  268.     function _decodeCommentsHeader($packetType$pageOffset)
  269.     {
  270.         $this->_decodeCommonHeader($packetType$pageOffset);
  271.         $this->_decodeBareCommentsHeader();
  272.         // The framing bit MUST be set to mark the end of the comments header.
  273.         $framing_bit unpack("Cdata"fread($this->_filePointer1));
  274.         if ($framing_bit['data'!= 1)
  275.             throw new PEAR_Exception("Stream Undecodable"OGG_VORBIS_ERROR_UNDECODABLE);
  276.     }
  277.  
  278.     /**
  279.      * Get the 6-byte identification string expected in the common header
  280.      */
  281.     function getIdentificationString({
  282.         return OGG_STREAM_CAPTURE_VORBIS;
  283.     }
  284.     
  285.     /**
  286.      * Version of the Vorbis specification referred to in the encoding of this stream.
  287.      *
  288.      * This method returns the version of the Vorbis specification (currently 0 (ZERO))
  289.      * referred to by the encoder of this stream.  The Vorbis specification is well-
  290.      * defined, and thus one does not expect this value to change on a frequent basis.
  291.      *
  292.      * @access  public
  293.      * @return  int 
  294.      */
  295.     function getEncoderVersion()
  296.     {
  297.         return ($this->_version);
  298.     }
  299.  
  300.     /**
  301.      * Number of channels used in this stream
  302.      *
  303.      * This function returns the number of channels used in this stream.  This
  304.      * can range from 1 to 255, but will likely be 2 (stereo) or 1 (mono).
  305.      *
  306.      * @access  public
  307.      * @return  int 
  308.      * @see     File_Ogg_Vorbis::isMono()
  309.      * @see     File_Ogg_Vorbis::isStereo()
  310.      * @see     File_Ogg_Vorbis::isQuadrophonic()
  311.      */
  312.     function getChannels()
  313.     {
  314.         return ($this->_channels);
  315.     }
  316.  
  317.     /**
  318.      * Samples per second.
  319.      *
  320.      * This function returns the number of samples used per second in this
  321.      * recording.  Probably the most common value here is 44,100.
  322.      *
  323.      * @return  int 
  324.      * @access  public
  325.      */
  326.     function getSampleRate()
  327.     {
  328.         return ($this->_sampleRate);
  329.     }
  330.  
  331.     /**
  332.      * Various bitrate measurements
  333.      *
  334.      * Gives an array of the values of four different types of bitrates for this
  335.      * stream. The nominal, maximum and minimum values are found within the file,
  336.      * whereas the average value is computed.
  337.      *
  338.      * @access  public
  339.      * @return  array 
  340.      */
  341.     function getBitrates()
  342.     {
  343.         return (array("nom" => $this->_nomBitrate"max" => $this->_maxBitrate"min" => $this->_minBitrate"avg" => $this->_avgBitrate));
  344.     }
  345.  
  346.     /**
  347.      * Gives the most accurate bitrate measurement from this stream.
  348.      *
  349.      * This function returns the most accurate bitrate measurement for this
  350.      * recording, depending on values set in the stream header.
  351.      *
  352.      * @access  public
  353.      * @return  float 
  354.      */
  355.     function getBitrate()
  356.     {
  357.         if ($this->_avgBitrate != 0)
  358.             return ($this->_avgBitrate);
  359.         elseif ($this->_nomBitrate != 0)
  360.             return ($this->_nomBitrate);
  361.         else
  362.             return (($this->_minBitrate $this->_maxBitrate/ 2);
  363.     }
  364.  
  365.     /**
  366.      * Gives the length (in seconds) of this stream.
  367.      *
  368.      * @access  public
  369.      * @return  int 
  370.      */
  371.     function getLength()
  372.     {
  373.         return ($this->_streamLength);
  374.     }
  375.     
  376.     /**
  377.      * States whether this logical stream was encoded in mono.
  378.      *
  379.      * @access  public
  380.      * @return  boolean 
  381.      */
  382.     function isMono()
  383.     {
  384.         return ($this->_channels == 1);
  385.     }
  386.     
  387.     /**
  388.      * States whether this logical stream was encoded in stereo.
  389.      *
  390.      * @access  public
  391.      * @return  boolean 
  392.      */
  393.     function isStereo()
  394.     {
  395.         return ($this->_channels == 2);
  396.     }
  397.     
  398.     /**
  399.      * States whether this logical stream was encoded in quadrophonic sound.
  400.      *
  401.      * @access  public
  402.      * @return  boolean 
  403.      */
  404.     function isQuadrophonic()
  405.     {
  406.         return ($this->_channels == 4);
  407.     }
  408.     
  409.     /**
  410.      * The title of this track, e.g. "What's Up Pussycat?".
  411.      *
  412.      * @access  public
  413.      * @return  string 
  414.      */
  415.     function getTitle()
  416.     {
  417.         return ($this->getField("TITLE"));
  418.     }
  419.     
  420.     /**
  421.      * Set the title of this track.
  422.      *
  423.      * @access  public
  424.      * @param   string  $title 
  425.      * @param   boolean $replace 
  426.      */
  427.     function setTitle($title$replace = true)
  428.     {
  429.         $this->setField("TITLE"$title$replace);
  430.     }
  431.     
  432.     /**
  433.      * The version of the track, such as a remix.
  434.      *
  435.      * @access  public
  436.      * @return  string 
  437.      */
  438.     function getVersion()
  439.     {
  440.         return $this->getField("VERSION");
  441.     }
  442.     
  443.     /**
  444.      * Set the version of this track.
  445.      *
  446.      * @access  public
  447.      * @param   string  $version 
  448.      * @param   boolean $replace 
  449.      */
  450.     function setVersion($version$replace = true)
  451.     {
  452.         $this->setField("VERSION"$version$replace);
  453.     }
  454.     
  455.     /**
  456.      * The album or collection from which this track comes.
  457.      *
  458.      * @access  public
  459.      * @return  string 
  460.      */
  461.     function getAlbum()
  462.     {
  463.         return ($this->getField("ALBUM"));
  464.     }
  465.     
  466.     /**
  467.      * Set the album or collection for this track.
  468.      *
  469.      * @access  public
  470.      * @param   string  $album 
  471.      * @param   boolean $replace 
  472.      */
  473.     function setAlbum($album$replace = true)
  474.     {
  475.         $this->setField("ALBUM"$album$replace);
  476.     }
  477.     
  478.     /**
  479.      * The number of this track if it is part of a larger collection.
  480.      *
  481.      * @access  public
  482.      * @return  string 
  483.      */
  484.     function getTrackNumber()
  485.     {
  486.         return ($this->getField("TRACKNUMBER"));
  487.     }
  488.     
  489.     /**
  490.      * Set the number of this relative to the collection.
  491.      *
  492.      * @access  public
  493.      * @param   int     $number 
  494.      * @param   boolean $replace 
  495.      */
  496.     function setTrackNumber($number$replace = true)
  497.     {
  498.         $this->setField("TRACKNUMBER"$number$replace);
  499.     }
  500.     
  501.     /**
  502.      * The artist responsible for this track.
  503.      *
  504.      * This function returns the name of the artist responsible for this
  505.      * recording, which may be either a solo-artist, duet or group.
  506.      *
  507.      * @access  public
  508.      * @return  string 
  509.      */
  510.     function getArtist()
  511.     {
  512.         return ($this->getField("ARTIST"));
  513.     }
  514.     
  515.     /**
  516.      * Set the artist of this track.
  517.      *
  518.      * @access  public
  519.      * @param   string  $artist 
  520.      * @param   boolean $replace 
  521.      */
  522.     function setArtist($artist$replace = true)
  523.     {
  524.         $this->setField("ARTIST"$artist$replace = true);
  525.     }
  526.     
  527.     /**
  528.      * The performer of this track, such as an orchestra
  529.      *
  530.      * @access  public
  531.      * @return  string 
  532.      */
  533.     function getPerformer()
  534.     {
  535.         return ($this->getField("PERFORMER"));
  536.     }
  537.     
  538.     /**
  539.      * Set the performer of this track.
  540.      *
  541.      * @access  public
  542.      * @param   string  $performer 
  543.      * @param   boolean $replace 
  544.      */
  545.     function setPerformer($performer$replace = true)
  546.     {
  547.         $this->setField("PERFORMER"$performer$replace);
  548.     }
  549.     
  550.     /**
  551.      * The copyright attribution for this track.
  552.      *
  553.      * @access  public
  554.      * @return  string 
  555.      */
  556.     function getCopyright()
  557.     {
  558.         return ($this->getField("COPYRIGHT"));
  559.     }
  560.     
  561.     /**
  562.      * Set the copyright attribution for this track.
  563.      *
  564.      * @access  public
  565.      * @param   string  $copyright 
  566.      * @param   boolean $replace 
  567.      */
  568.     function setCopyright($copyright$replace = true)
  569.     {
  570.         $this->setField("COPYRIGHT"$copyright$replace);
  571.     }
  572.     
  573.     /**
  574.      * The rights of distribution for this track.
  575.      *
  576.      * This funtion returns the license for this track, and may include
  577.      * copyright information, or a creative commons statement.
  578.      *
  579.      * @access  public
  580.      * @return  string 
  581.      */
  582.     function getLicense()
  583.     {
  584.         return ($this->getField("LICENSE"));
  585.     }
  586.     
  587.     /**
  588.      * Set the distribution rights for this track.
  589.      *
  590.      * @access  public
  591.      * @param   string  $license 
  592.      * @param   boolean $replace 
  593.      */
  594.     function setLicense($license$replace = true)
  595.     {
  596.         $this->setField("LICENSE"$license$replace);
  597.     }
  598.     
  599.     /**
  600.      * The organisation responsible for this track.
  601.      *
  602.      * This function returns the name of the organisation responsible for
  603.      * the production of this track, such as the record label.
  604.      *
  605.      * @access  public
  606.      * @return  string 
  607.      */
  608.     function getOrganization()
  609.     {
  610.         return ($this->getField("ORGANIZATION"));
  611.     }
  612.     
  613.     /**
  614.      * Set the organisation responsible for this track.
  615.      *
  616.      * @access  public
  617.      * @param   string  $organization 
  618.      * @param   boolean $replace 
  619.      */
  620.     function setOrganziation($organization$replace = true)
  621.     {
  622.         $this->setField("ORGANIZATION"$organization$replace);
  623.     }
  624.     
  625.     /**
  626.      * A short description of the contents of this track.
  627.      *
  628.      * This function returns a short description of this track, which might
  629.      * contain extra information that doesn't fit anywhere else.
  630.      *
  631.      * @access  public
  632.      * @return  string 
  633.      */
  634.     function getDescription()
  635.     {
  636.         return ($this->getField("DESCRIPTION"));
  637.     }
  638.     
  639.     /**
  640.      * Set the description of this track.
  641.      *
  642.      * @access  public
  643.      * @param   string  $description 
  644.      * @param   boolean $replace 
  645.      */
  646.     function setDescription($description$replace = true)
  647.     {
  648.         $this->setField("DESCRIPTION"$replace);
  649.     }
  650.     
  651.     /**
  652.      * The genre of this recording (e.g. Rock)
  653.      *
  654.      * This function returns the genre of this recording.  There are no pre-
  655.      * defined genres, so this is completely up to the tagging software.
  656.      *
  657.      * @access  public
  658.      * @return  string 
  659.      */
  660.     function getGenre()
  661.     {
  662.         return ($this->getField("GENRE"));
  663.     }
  664.     
  665.     /**
  666.      * Set the genre of this track.
  667.      *
  668.      * @access  public
  669.      * @param   string  $genre 
  670.      * @param   boolean $replace 
  671.      */
  672.     function setGenre($genre$replace = true)
  673.     {
  674.         $this->setField("GENRE"$genre$replace);
  675.     }
  676.     
  677.     /**
  678.      * The date of the recording of this track.
  679.      *
  680.      * This function returns the date on which this recording was made.  There
  681.      * is no specification for the format of this date.
  682.      *
  683.      * @access  public
  684.      * @return  string 
  685.      */
  686.     function getDate()
  687.     {
  688.         return ($this->getField("DATE"));
  689.     }
  690.     
  691.     /**
  692.      * Set the date of recording for this track.
  693.      *
  694.      * @access  public
  695.      * @param   string  $date 
  696.      * @param   boolean $replace 
  697.      */
  698.     function setDate($date$replace = true)
  699.     {
  700.         $this->setField("DATE"$date$replace);
  701.     }
  702.     
  703.     /**
  704.      * Where this recording was made.
  705.      *
  706.      * This function returns where this recording was made, such as a recording
  707.      * studio, or concert venue.
  708.      *
  709.      * @access  public
  710.      * @return  string 
  711.      */
  712.     function getLocation()
  713.     {
  714.         return ($this->getField("LOCATION"));
  715.     }
  716.     
  717.     /**
  718.      * Set the location of the recording of this track.
  719.      *
  720.      * @access  public
  721.      * @param   string  $location 
  722.      * @param   boolean $replace 
  723.      */
  724.     function setLocation($location$replace = true)
  725.     {
  726.         $this->setField("LOCATION"$location$replace);
  727.     }
  728.     
  729.     /**
  730.      * @access  public
  731.      * @return  string 
  732.      */
  733.     function getContact()
  734.     {
  735.         return ($this->getField("CONTACT"));
  736.     }
  737.     
  738.     /**
  739.      * Set the contact information for this track.
  740.      *
  741.      * @access  public
  742.      * @param   string  $contact 
  743.      * @param   boolean $replace 
  744.      */
  745.     function setContact($contact$replace = true)
  746.     {
  747.         $this->setField("CONTACT"$contact$replace);
  748.     }
  749.     
  750.     /**
  751.      * International Standard Recording Code.
  752.      *
  753.      * Returns the International Standard Recording Code.  This code can be
  754.      * validated using the Validate_ISPN package.
  755.      *
  756.      * @access  public
  757.      * @return  string 
  758.      */
  759.     function getIsrc()
  760.     {
  761.         return ($this->getField("ISRC"));
  762.     }
  763.     
  764.     /**
  765.      *  Set the ISRC for this track.
  766.      *
  767.      * @access  public
  768.      * @param   string  $isrc 
  769.      * @param   boolean $replace 
  770.      */
  771.     function setIsrc($isrc$replace = true)
  772.     {
  773.         $this->setField("ISRC"$isrc$replace);
  774.     }
  775.  
  776.     /**
  777.      * Get an associative array containing header information about the stream
  778.      * @access  public
  779.      * @return  array 
  780.      */
  781.     function getHeader({
  782.         return $this->_idHeader;
  783.     }
  784. }
  785. ?>

Documentation generated on Mon, 11 Mar 2019 15:15:22 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.