You are here

public function PHPVideoToolkit::extractAudio in Video 7

Same name and namespace in other branches
  1. 7.2 libraries/phpvideotoolkit/phpvideotoolkit.php5.php \PHPVideoToolkit::extractAudio()

* This is an alias for setFormat, but restricts it to audio only formats. * * @access public *

Parameters

integer $format A supported audio format.: * @param integer $audio_sample_frequency * @param integer $audio_bitrate *

File

libraries/phpvideotoolkit/phpvideotoolkit.php5.php, line 1322

Class

PHPVideoToolkit

Code

public function extractAudio($format = PHPVideoToolkit::FORMAT_MP3, $audio_sample_frequency = 44100, $audio_bitrate = 64) {

  // 			check the format is one of the audio formats
  if (!in_array($format, array(
    self::FORMAT_AAC,
    self::FORMAT_AIFF,
    self::FORMAT_MP2,
    self::FORMAT_MP3,
    self::FORMAT_MP4,
    self::FORMAT_MPEG4,
    self::FORMAT_M4A,
    self::FORMAT_WAV,
  ))) {
    return $this
      ->_raiseError('extractAudio_valid_format', array(
      'format' => $format,
    ));

    //<-			exits
  }
  $this
    ->setFormat($format);

  //			adjust the audio rates
  $this
    ->setAudioBitRate($audio_bitrate);
  $this
    ->setAudioSampleFrequency($audio_sample_frequency);
}