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 302834 2010-08-27 02:16:20Z tstarling $
  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.      * the start offset of this stream in seconds
  154.      */
  155.     var $_startOffset;
  156.     /**
  157.      * Constructor for accessing a Vorbis logical stream.
  158.      *
  159.      * This method is the constructor for the native-PHP interface to a Vorbis logical
  160.      * stream, embedded within an Ogg physical stream.
  161.      *
  162.      * @param   int     $streamSerial   Serial number of the logical stream.
  163.      * @param   array   $streamData     Data for the requested logical stream.
  164.      * @param   string  $filePath       Location of a file on the filesystem.
  165.      * @param   pointer $filePointer    File pointer for the current physical stream.
  166.      * @access  private
  167.      */
  168.     function __construct($streamSerial$streamData$filePointer)
  169.     {
  170.         parent::__construct($streamSerial$streamData$filePointer);
  171.         $this->_decodeIdentificationHeader();
  172.         $this->_decodeCommentsHeader(OGG_VORBIS_COMMENTS_HEADEROGG_VORBIS_COMMENTS_PAGE_OFFSET);
  173.  
  174.         $endSec =  $this->getSecondsFromGranulePos$this->_lastGranulePos );
  175.         $startSec $this->getSecondsFromGranulePos$this->_firstGranulePos );
  176.  
  177.         //make sure the offset is worth taking into account oggz_chop related hack
  178.         if$startSec > 1){
  179.             $this->_streamLength $endSec $startSec;
  180.             $this->_startOffset $startSec;
  181.         }else{
  182.             $this->_streamLength $endSec;
  183.         }
  184.  
  185.         $this->_avgBitrate      $this->_streamLength ($this->_streamSize * 8$this->_streamLength : 0;
  186.     }
  187.     function getSecondsFromGranulePos$granulePos ){
  188.         return (( '0x' substr$granulePos0) ) pow(232)
  189.             + '0x' substr$granulePos8) ))
  190.             / $this->_idHeader['audio_sample_rate'];
  191.     }
  192.     /**
  193.      * Get a short string describing the type of the stream
  194.      */
  195.     function getType()
  196.     {
  197.         return 'Vorbis';
  198.     }
  199.  
  200.     /**
  201.      * Parse the identification header (the first of three headers) in a Vorbis stream.
  202.      *
  203.      * This function parses the identification header.  The identification header
  204.      * contains simple audio characteristics, such as sample rate and number of
  205.      * channels.  There are a number of error-checking provisions laid down in the Vorbis
  206.      * specification to ensure the stream is pure.
  207.      *
  208.      * @access  private
  209.      */
  210.     function _decodeIdentificationHeader()
  211.     {
  212.         $this->_decodeCommonHeader(OGG_VORBIS_IDENTIFICATION_HEADEROGG_VORBIS_IDENTIFICATION_PAGE_OFFSET);
  213.  
  214.         $h File_Ogg::_readLittleEndian($this->_filePointerarray(
  215.             'vorbis_version'        => 32,
  216.             'audio_channels'        => 8,
  217.             'audio_sample_rate'     => 32,
  218.             'bitrate_maximum'       => 32,
  219.             'bitrate_nominal'       => 32,
  220.             'bitrate_minimum'       => 32,
  221.             'blocksize_0'           => 4,
  222.             'blocksize_1'           => 4,
  223.             'framing_flag'          => 1
  224.         ));
  225.  
  226.         // The Vorbis stream version must be 0.
  227.         if ($h['vorbis_version'== 0)
  228.             $this->_version $h['vorbis_version'];
  229.         else
  230.             throw new PEAR_Exception("Stream is undecodable due to an invalid vorbis stream version."OGG_VORBIS_ERROR_UNDECODABLE);
  231.  
  232.         // The number of channels MUST be greater than 0.
  233.         if ($h['audio_channels'== 0)
  234.             throw new PEAR_Exception("Stream is undecodable due to zero channels."OGG_VORBIS_ERROR_UNDECODABLE);
  235.         else
  236.             $this->_channels $h['audio_channels'];
  237.  
  238.         // The sample rate MUST be greater than 0.
  239.         if ($h['audio_sample_rate'== 0)
  240.             throw new PEAR_Exception("Stream is undecodable due to a zero sample rate."OGG_VORBIS_ERROR_UNDECODABLE);
  241.         else
  242.             $this->_sampleRate $h['audio_sample_rate'];
  243.  
  244.         // Extract the various bitrates
  245.         $this->_maxBitrate  $h['bitrate_maximum'];
  246.         $this->_nomBitrate  $h['bitrate_nominal'];
  247.         $this->_minBitrate  $h['bitrate_minimum'];
  248.  
  249.         // Powers of two between 6 and 13 inclusive.
  250.         $valid_block_sizes = array(641282565121024204840968192);
  251.  
  252.         // blocksize_0 MUST be a valid blocksize.
  253.         $blocksize_0 pow(2$h['blocksize_0']);
  254.         if (FALSE == in_array($blocksize_0$valid_block_sizes))
  255.             throw new PEAR_Exception("Stream is undecodable because blocksize_0 is $blocksize_0, which is not a valid size."OGG_VORBIS_ERROR_UNDECODABLE);
  256.  
  257.         // Extract bits 5 to 8 from the character data.
  258.         // blocksize_1 MUST be a valid blocksize.
  259.         $blocksize_1 pow(2$h['blocksize_1']);
  260.         if (FALSE == in_array($blocksize_1$valid_block_sizes))
  261.             throw new PEAR_Exception("Stream is undecodable because blocksize_1 is not a valid size."OGG_VORBIS_ERROR_UNDECODABLE);
  262.  
  263.         // blocksize 0 MUST be less than or equal to blocksize 1.
  264.         if ($blocksize_0 $blocksize_1)
  265.             throw new PEAR_Exception("Stream is undecodable because blocksize_0 is not less than or equal to blocksize_1."OGG_VORBIS_ERROR_UNDECODABLE);
  266.  
  267.         // The framing bit MUST be set to mark the end of the identification header.
  268.         // Some encoders are broken though -- TS
  269.         /*
  270.         if ($h['framing_flag'] == 0)
  271.             throw new PEAR_Exception("Stream in undecodable because the framing bit is not non-zero.", OGG_VORBIS_ERROR_UNDECODABLE);
  272.          */
  273.  
  274.         $this->_idHeader $h;
  275.     }
  276.  
  277.     /**
  278.      * Decode the comments header
  279.      * @access  private
  280.      * @param   int     $packetType 
  281.      * @param   int     $pageOffset 
  282.      */
  283.     function _decodeCommentsHeader($packetType$pageOffset)
  284.     {
  285.         $this->_decodeCommonHeader($packetType$pageOffset);
  286.         $this->_decodeBareCommentsHeader();
  287.         // The framing bit MUST be set to mark the end of the comments header.
  288.         $framing_bit unpack("Cdata"fread($this->_filePointer1));
  289.         if ($framing_bit['data'!= 1)
  290.             throw new PEAR_Exception("Stream Undecodable"OGG_VORBIS_ERROR_UNDECODABLE);
  291.     }
  292.  
  293.     /**
  294.      * Get the 6-byte identification string expected in the common header
  295.      */
  296.     function getIdentificationString({
  297.         return OGG_STREAM_CAPTURE_VORBIS;
  298.     }
  299.  
  300.     /**
  301.      * Version of the Vorbis specification referred to in the encoding of this stream.
  302.      *
  303.      * This method returns the version of the Vorbis specification (currently 0 (ZERO))
  304.      * referred to by the encoder of this stream.  The Vorbis specification is well-
  305.      * defined, and thus one does not expect this value to change on a frequent basis.
  306.      *
  307.      * @access  public
  308.      * @return  int 
  309.      */
  310.     function getEncoderVersion()
  311.     {
  312.         return ($this->_version);
  313.     }
  314.  
  315.     /**
  316.      * Number of channels used in this stream
  317.      *
  318.      * This function returns the number of channels used in this stream.  This
  319.      * can range from 1 to 255, but will likely be 2 (stereo) or 1 (mono).
  320.      *
  321.      * @access  public
  322.      * @return  int 
  323.      * @see     File_Ogg_Vorbis::isMono()
  324.      * @see     File_Ogg_Vorbis::isStereo()
  325.      * @see     File_Ogg_Vorbis::isQuadrophonic()
  326.      */
  327.     function getChannels()
  328.     {
  329.         return ($this->_channels);
  330.     }
  331.  
  332.     /**
  333.      * Samples per second.
  334.      *
  335.      * This function returns the number of samples used per second in this
  336.      * recording.  Probably the most common value here is 44,100.
  337.      *
  338.      * @return  int 
  339.      * @access  public
  340.      */
  341.     function getSampleRate()
  342.     {
  343.         return ($this->_sampleRate);
  344.     }
  345.  
  346.     /**
  347.      * Various bitrate measurements
  348.      *
  349.      * Gives an array of the values of four different types of bitrates for this
  350.      * stream. The nominal, maximum and minimum values are found within the file,
  351.      * whereas the average value is computed.
  352.      *
  353.      * @access  public
  354.      * @return  array 
  355.      */
  356.     function getBitrates()
  357.     {
  358.         return (array("nom" => $this->_nomBitrate"max" => $this->_maxBitrate"min" => $this->_minBitrate"avg" => $this->_avgBitrate));
  359.     }
  360.  
  361.     /**
  362.      * Gives the most accurate bitrate measurement from this stream.
  363.      *
  364.      * This function returns the most accurate bitrate measurement for this
  365.      * recording, depending on values set in the stream header.
  366.      *
  367.      * @access  public
  368.      * @return  float 
  369.      */
  370.     function getBitrate()
  371.     {
  372.         if ($this->_avgBitrate != 0)
  373.             return ($this->_avgBitrate);
  374.         elseif ($this->_nomBitrate != 0)
  375.             return ($this->_nomBitrate);
  376.         else
  377.             return (($this->_minBitrate $this->_maxBitrate/ 2);
  378.     }
  379.  
  380.     /**
  381.      * Gives the length (in seconds) of this stream.
  382.      *
  383.      * @access  public
  384.      * @return  int 
  385.      */
  386.     function getLength()
  387.     {
  388.         return ($this->_streamLength);
  389.     }
  390.      /**
  391.      * Get the start offset of the stream in seconds
  392.      * @access public
  393.      * @return int 
  394.      */
  395.     function getStartOffset(){
  396.         return ($this->_startOffset);
  397.     }
  398.     /**
  399.      * States whether this logical stream was encoded in mono.
  400.      *
  401.      * @access  public
  402.      * @return  boolean 
  403.      */
  404.     function isMono()
  405.     {
  406.         return ($this->_channels == 1);
  407.     }
  408.  
  409.     /**
  410.      * States whether this logical stream was encoded in stereo.
  411.      *
  412.      * @access  public
  413.      * @return  boolean 
  414.      */
  415.     function isStereo()
  416.     {
  417.         return ($this->_channels == 2);
  418.     }
  419.  
  420.     /**
  421.      * States whether this logical stream was encoded in quadrophonic sound.
  422.      *
  423.      * @access  public
  424.      * @return  boolean 
  425.      */
  426.     function isQuadrophonic()
  427.     {
  428.         return ($this->_channels == 4);
  429.     }
  430.  
  431.     /**
  432.      * The title of this track, e.g. "What's Up Pussycat?".
  433.      *
  434.      * @access  public
  435.      * @return  string 
  436.      */
  437.     function getTitle()
  438.     {
  439.         return ($this->getField("TITLE"));
  440.     }
  441.  
  442.     /**
  443.      * Set the title of this track.
  444.      *
  445.      * @access  public
  446.      * @param   string  $title 
  447.      * @param   boolean $replace 
  448.      */
  449.     function setTitle($title$replace = true)
  450.     {
  451.         $this->setField("TITLE"$title$replace);
  452.     }
  453.  
  454.     /**
  455.      * The version of the track, such as a remix.
  456.      *
  457.      * @access  public
  458.      * @return  string 
  459.      */
  460.     function getVersion()
  461.     {
  462.         return $this->getField("VERSION");
  463.     }
  464.  
  465.     /**
  466.      * Set the version of this track.
  467.      *
  468.      * @access  public
  469.      * @param   string  $version 
  470.      * @param   boolean $replace 
  471.      */
  472.     function setVersion($version$replace = true)
  473.     {
  474.         $this->setField("VERSION"$version$replace);
  475.     }
  476.  
  477.     /**
  478.      * The album or collection from which this track comes.
  479.      *
  480.      * @access  public
  481.      * @return  string 
  482.      */
  483.     function getAlbum()
  484.     {
  485.         return ($this->getField("ALBUM"));
  486.     }
  487.  
  488.     /**
  489.      * Set the album or collection for this track.
  490.      *
  491.      * @access  public
  492.      * @param   string  $album 
  493.      * @param   boolean $replace 
  494.      */
  495.     function setAlbum($album$replace = true)
  496.     {
  497.         $this->setField("ALBUM"$album$replace);
  498.     }
  499.  
  500.     /**
  501.      * The number of this track if it is part of a larger collection.
  502.      *
  503.      * @access  public
  504.      * @return  string 
  505.      */
  506.     function getTrackNumber()
  507.     {
  508.         return ($this->getField("TRACKNUMBER"));
  509.     }
  510.  
  511.     /**
  512.      * Set the number of this relative to the collection.
  513.      *
  514.      * @access  public
  515.      * @param   int     $number 
  516.      * @param   boolean $replace 
  517.      */
  518.     function setTrackNumber($number$replace = true)
  519.     {
  520.         $this->setField("TRACKNUMBER"$number$replace);
  521.     }
  522.  
  523.     /**
  524.      * The artist responsible for this track.
  525.      *
  526.      * This function returns the name of the artist responsible for this
  527.      * recording, which may be either a solo-artist, duet or group.
  528.      *
  529.      * @access  public
  530.      * @return  string 
  531.      */
  532.     function getArtist()
  533.     {
  534.         return ($this->getField("ARTIST"));
  535.     }
  536.  
  537.     /**
  538.      * Set the artist of this track.
  539.      *
  540.      * @access  public
  541.      * @param   string  $artist 
  542.      * @param   boolean $replace 
  543.      */
  544.     function setArtist($artist$replace = true)
  545.     {
  546.         $this->setField("ARTIST"$artist$replace = true);
  547.     }
  548.  
  549.     /**
  550.      * The performer of this track, such as an orchestra
  551.      *
  552.      * @access  public
  553.      * @return  string 
  554.      */
  555.     function getPerformer()
  556.     {
  557.         return ($this->getField("PERFORMER"));
  558.     }
  559.  
  560.     /**
  561.      * Set the performer of this track.
  562.      *
  563.      * @access  public
  564.      * @param   string  $performer 
  565.      * @param   boolean $replace 
  566.      */
  567.     function setPerformer($performer$replace = true)
  568.     {
  569.         $this->setField("PERFORMER"$performer$replace);
  570.     }
  571.  
  572.     /**
  573.      * The copyright attribution for this track.
  574.      *
  575.      * @access  public
  576.      * @return  string 
  577.      */
  578.     function getCopyright()
  579.     {
  580.         return ($this->getField("COPYRIGHT"));
  581.     }
  582.  
  583.     /**
  584.      * Set the copyright attribution for this track.
  585.      *
  586.      * @access  public
  587.      * @param   string  $copyright 
  588.      * @param   boolean $replace 
  589.      */
  590.     function setCopyright($copyright$replace = true)
  591.     {
  592.         $this->setField("COPYRIGHT"$copyright$replace);
  593.     }
  594.  
  595.     /**
  596.      * The rights of distribution for this track.
  597.      *
  598.      * This funtion returns the license for this track, and may include
  599.      * copyright information, or a creative commons statement.
  600.      *
  601.      * @access  public
  602.      * @return  string 
  603.      */
  604.     function getLicense()
  605.     {
  606.         return ($this->getField("LICENSE"));
  607.     }
  608.  
  609.     /**
  610.      * Set the distribution rights for this track.
  611.      *
  612.      * @access  public
  613.      * @param   string  $license 
  614.      * @param   boolean $replace 
  615.      */
  616.     function setLicense($license$replace = true)
  617.     {
  618.         $this->setField("LICENSE"$license$replace);
  619.     }
  620.  
  621.     /**
  622.      * The organisation responsible for this track.
  623.      *
  624.      * This function returns the name of the organisation responsible for
  625.      * the production of this track, such as the record label.
  626.      *
  627.      * @access  public
  628.      * @return  string 
  629.      */
  630.     function getOrganization()
  631.     {
  632.         return ($this->getField("ORGANIZATION"));
  633.     }
  634.  
  635.     /**
  636.      * Set the organisation responsible for this track.
  637.      *
  638.      * @access  public
  639.      * @param   string  $organization 
  640.      * @param   boolean $replace 
  641.      */
  642.     function setOrganziation($organization$replace = true)
  643.     {
  644.         $this->setField("ORGANIZATION"$organization$replace);
  645.     }
  646.  
  647.     /**
  648.      * A short description of the contents of this track.
  649.      *
  650.      * This function returns a short description of this track, which might
  651.      * contain extra information that doesn't fit anywhere else.
  652.      *
  653.      * @access  public
  654.      * @return  string 
  655.      */
  656.     function getDescription()
  657.     {
  658.         return ($this->getField("DESCRIPTION"));
  659.     }
  660.  
  661.     /**
  662.      * Set the description of this track.
  663.      *
  664.      * @access  public
  665.      * @param   string  $description 
  666.      * @param   boolean $replace 
  667.      */
  668.     function setDescription($description$replace = true)
  669.     {
  670.         $this->setField("DESCRIPTION"$replace);
  671.     }
  672.  
  673.     /**
  674.      * The genre of this recording (e.g. Rock)
  675.      *
  676.      * This function returns the genre of this recording.  There are no pre-
  677.      * defined genres, so this is completely up to the tagging software.
  678.      *
  679.      * @access  public
  680.      * @return  string 
  681.      */
  682.     function getGenre()
  683.     {
  684.         return ($this->getField("GENRE"));
  685.     }
  686.  
  687.     /**
  688.      * Set the genre of this track.
  689.      *
  690.      * @access  public
  691.      * @param   string  $genre 
  692.      * @param   boolean $replace 
  693.      */
  694.     function setGenre($genre$replace = true)
  695.     {
  696.         $this->setField("GENRE"$genre$replace);
  697.     }
  698.  
  699.     /**
  700.      * The date of the recording of this track.
  701.      *
  702.      * This function returns the date on which this recording was made.  There
  703.      * is no specification for the format of this date.
  704.      *
  705.      * @access  public
  706.      * @return  string 
  707.      */
  708.     function getDate()
  709.     {
  710.         return ($this->getField("DATE"));
  711.     }
  712.  
  713.     /**
  714.      * Set the date of recording for this track.
  715.      *
  716.      * @access  public
  717.      * @param   string  $date 
  718.      * @param   boolean $replace 
  719.      */
  720.     function setDate($date$replace = true)
  721.     {
  722.         $this->setField("DATE"$date$replace);
  723.     }
  724.  
  725.     /**
  726.      * Where this recording was made.
  727.      *
  728.      * This function returns where this recording was made, such as a recording
  729.      * studio, or concert venue.
  730.      *
  731.      * @access  public
  732.      * @return  string 
  733.      */
  734.     function getLocation()
  735.     {
  736.         return ($this->getField("LOCATION"));
  737.     }
  738.  
  739.     /**
  740.      * Set the location of the recording of this track.
  741.      *
  742.      * @access  public
  743.      * @param   string  $location 
  744.      * @param   boolean $replace 
  745.      */
  746.     function setLocation($location$replace = true)
  747.     {
  748.         $this->setField("LOCATION"$location$replace);
  749.     }
  750.  
  751.     /**
  752.      * @access  public
  753.      * @return  string 
  754.      */
  755.     function getContact()
  756.     {
  757.         return ($this->getField("CONTACT"));
  758.     }
  759.  
  760.     /**
  761.      * Set the contact information for this track.
  762.      *
  763.      * @access  public
  764.      * @param   string  $contact 
  765.      * @param   boolean $replace 
  766.      */
  767.     function setContact($contact$replace = true)
  768.     {
  769.         $this->setField("CONTACT"$contact$replace);
  770.     }
  771.  
  772.     /**
  773.      * International Standard Recording Code.
  774.      *
  775.      * Returns the International Standard Recording Code.  This code can be
  776.      * validated using the Validate_ISPN package.
  777.      *
  778.      * @access  public
  779.      * @return  string 
  780.      */
  781.     function getIsrc()
  782.     {
  783.         return ($this->getField("ISRC"));
  784.     }
  785.  
  786.     /**
  787.      *  Set the ISRC for this track.
  788.      *
  789.      * @access  public
  790.      * @param   string  $isrc 
  791.      * @param   boolean $replace 
  792.      */
  793.     function setIsrc($isrc$replace = true)
  794.     {
  795.         $this->setField("ISRC"$isrc$replace);
  796.     }
  797.  
  798.     /**
  799.      * Get an associative array containing header information about the stream
  800.      * @access  public
  801.      * @return  array 
  802.      */
  803.     function getHeader({
  804.         return $this->_idHeader;
  805.     }
  806. }
  807. ?>

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