classes/Video.php
public function getAudioStream($from = null, $to = null)
    {
        if (isset($this->_type) && $this->_type == 'playlist') {
            throw new Exception(_('Conversion of playlists is not supported.'));
        }

        if (isset($this->protocol)) {
            if (in_array($this->protocol, ['m3u8', 'm3u8_native'])) {
                throw new Exception(_('Conversion of M3U8 files is not supported.'));
            } elseif ($this->protocol == 'http_dash_segments') {
                throw new Exception(_('Conversion of DASH segments is not supported.'));
            }
        }

        $avconvProc = $this->getAvconvProcess($this->config->audioBitrate, 'mp3', true, $from, $to);

        $stream = popen($avconvProc->getCommandLine(), 'r');

        if (!is_resource($stream)) {
            throw new Exception(_('Could not open popen stream.'));
        }

        return $stream;
    }
public function getAudioStream($from = null, $to = null)
    {
        if (isset($this->_type) && $this->_type == 'playlist') {
            throw new Exception(_('Conversion of playlists is not supported.'));
        }

        if (isset($this->protocol)) {
            if (in_array($this->protocol, ['m3u8', 'm3u8_native'])) {
                throw new Exception(_('Conversion of M3U8 files is not supported.'));
            } elseif ($this->protocol == 'http_dash_segments') {
                throw new Exception(_('Conversion of DASH segments is not supported.'));
            }
        }

        $avconvProc = $this->getAvconvProcess($this->config->audioBitrate, 'mp3', true, $from, $to);

        $stream = popen($avconvProc->getCommandLine(), 'r');

        if (!is_resource($stream)) {
            throw new Exception(_('Could not open popen stream.'));
        }

        return $stream;
    }
public function getAudioStream ( $ from = null , $ to = null ) { if ( isset ( $ this -> _type ) && $ this -> _type == 'playlist' ) { throw new Exception ( _ ( 'Conversion of playlists is not supported.' ) ) ; } if ( isset ( $ this -> protocol ) ) { if ( in_array ( $ this -> protocol , [ 'm3u8' , 'm3u8_native' ] ) ) { throw new Exception ( _ ( 'Conversion of M3U8 files is not supported.' ) ) ; } elseif ( $ this -> protocol == 'http_dash_segments' ) { throw new Exception ( _ ( 'Conversion of DASH segments is not supported.' ) ) ; } } $ avconvProc = $ this -> getAvconvProcess ( $ this -> config -> audioBitrate , 'mp3' , true , $ from , $ to ) ; $ stream = popen ( $ avconvProc -> getCommandLine ( ) , 'r' ) ; if ( ! is_resource ( $ stream ) ) { throw new Exception ( _ ( 'Could not open popen stream.' ) ) ; } return $ stream ; }
Get audio stream of converted video.

@param string $from Start the conversion at this time
@param string $to   End the conversion at this time

@throws Exception If your try to convert an M3U8 video
@throws Exception If the popen stream was not created correctly

@return resource popen stream
Get audio stream of converted video .