UNA
Loading...
Searching...
No Matches
BxDolTranscoderAudio Class Reference
Inheritance diagram for BxDolTranscoderAudio:
BxDolTranscoderVideo iBxDolFactoryObject BxDolTranscoder iBxDolFactoryObject BxDolFactory iBxDolFactoryObject

Public Member Functions

 isMimeTypeSupported ($sMimeType)
 
- Public Member Functions inherited from BxDolTranscoderVideo
 getDevicePixelRatioHandlerSuffix ()
 
 getFileUrlNotReady ($mixedHandler)
 
 isProcessHD ($sOrigVideoDim)
 
 getSize ($sFile)
 
- Public Member Functions inherited from BxDolTranscoder
 onDeleteFileLocal ($iFileId)
 
 onDeleteFileOrig ($mixedHandler)
 
 registerHandlers ()
 
 unregisterHandlers ()
 
 cleanup ()
 
 getStorage ()
 
 getDb ()
 
 getFileUrl ($mixedHandler)
 
 getFileUrlById ($mixedHandler)
 
 isFileReady ($mixedHandler, $isCheckOutdated=true)
 
 transcode ($mixedHandler, $iProfileId=0)
 
 prune ()
 
 forceDevicePixelRatio ($i)
 
 getDevicePixelRatio ()
 
 getOrigFileUrl ($mixedHandler)
 
 getTmpFilename ($sOverrideName=false)
 
 clearLog ()
 
 addToLog ($s)
 
 getLog ()
 
 deleteFromQueue ($mixedHandler)
 
 storeTranscodedFile ($mixedHandler, $sTmpFile, $iProfileId)
 
 getFilterParams ($sName)
 
 getMaxResizeDimention ($sFilter='Resize', $sKey='')
 
 isMobile ()
 

Protected Member Functions

 __construct ($aObject, $oStorage)
 
 applyFilter_Mp3 ($sFile, $aParams)
 
- Protected Member Functions inherited from BxDolTranscoderVideo
 applyFilter_Poster ($sFile, $aParams)
 
 applyFilter_Mp4 ($sFile, $aParams)
 
 applyFilter_Webm ($sFile, $aParams)
 
 _convertVideo ($sFile, $sFileOut, $sExt, $aParams, $aOptions)
 
 _getOptionSizeForVideo ($sFile, $aParams)
 
 _getFfmpegThreadsParams ()
 
- Protected Member Functions inherited from BxDolTranscoder
 storeTranscodedFileInQueueStorage ($mixedHandler, $sTmpFile, &$sFileUrlResult)
 
 addToQueue ($mixedHandler, $iProfileId=0)
 
 applyFilter_Resize ($sFile, $aParams)
 
 isFileReady_Folder ($mixedHandlerOrig, $isCheckOutdated=true)
 
 isFileReady_Storage ($mixedHandlerOrig, $isCheckOutdated=true)
 
 isPrivate_Folder ($mixedHandler)
 
 isPrivate_Storage ($mixedHandler)
 
 getFilePath_Folder ($mixedHandler)
 
 storeFileLocally_Folder ($mixedHandler)
 
 storeFileLocally_Storage ($mixedHandler)
 
 storeFileLocally_Queue ($mixedHandler)
 
 getOrigFileUrl_Folder ($mixedHandler)
 
 getOrigFileUrl_Storage ($mixedHandler)
 
 initFilters ()
 
 clearCacheDB ()
 
 processHandlerForRetinaDevice ($mixedHandler)
 

Additional Inherited Members

- Static Public Member Functions inherited from BxDolTranscoderVideo
static getObjectAbstract ()
 
static getDuration ($sFile)
 
- Static Public Member Functions inherited from BxDolTranscoder
static getObjectInstance ($sObject)
 
static pruning ()
 
static processQueue ($bQueuePruning=true)
 
static pruneQueue ()
 
static processCompleted ()
 
static registerHandlersArray ($mixed)
 
static registerHandlersSystem ()
 
static unregisterHandlersArray ($mixed)
 
static cleanupObjectsArray ($mixed)
 
static onAlertResponseFileDeleteLocal ($oAlert, $sObject)
 
static onAlertResponseFileDeleteOrig ($oAlert, $sObject)
 
- Static Protected Member Functions inherited from BxDolTranscoder
static getTranscoderObjects ()
 
static _callFuncForObjectsArray ($mixed, $sFunc)
 
- Protected Attributes inherited from BxDolTranscoder
 $_sLog = ''
 
 $_aObject
 
 $_oStorage
 
 $_oDb
 
 $_sRetinaSuffix = '@2x'
 
 $_sQueueTable = ''
 
 $_sQueueStorage = ''
 
 $_iDevicePixelRatio = false
 

Detailed Description

This class transcodes audio files.

To generate audio which plays in all moders browsers, you need to generate .mp3 audio. Audio is converting upon first access, so it is probably better to force audio conversion by calling

See also
BxDolTranscoderAudio\getFileUrl just after video uploading. Audio for conversion is queued and when cron is run video conversion is performed.

Transcoder object and other params are the same as in

See also
BxDolTranscoderImage, but it is highly recommended to disable 'atime_pruning' and 'atime_tracking', or set it to fairly big value, since audio transcoding is not performed on the fly and takes some time.

Available filters:

  • Mp3 - this filter convert audio into .mp3 format, the parameters are the following:
    • audio_bitrate - audio bitrate in kb (128k by default)
    • ffmpeg_options - additional command line options for ffmepeg, as key => value array (empty by default)

Example of usage:

// transcoder object which generate .mp3 file
$oTranscoderMp3 = BxDolTranscoder::getObjectInstance('bx_audio_mp3');
// make sure to call it only once (for example: during module installation), before the first usage, no need to call it every time
$oTranscoderMp3->registerHandlers();
// get URLs of transcoded videos and video thumbnail, 33 is ID of original video file stored in specified storage object
$sUrlMp3 = $oTranscoderMp3->getFileUrl(33);
echo 'My voice: <audio controls><source src="' . $sUrlMp3 . '" type="audio/mpeg"></audio>';
static getObjectInstance($sObject)
Definition BxDolTranscoder.php:52

Also

See also
transcoder_audio sample for complete example.

Constructor & Destructor Documentation

◆ __construct()

BxDolTranscoderAudio::__construct ( $aObject,
$oStorage )
protected

constructor

Reimplemented from BxDolTranscoderVideo.

Member Function Documentation

◆ applyFilter_Mp3()

BxDolTranscoderAudio::applyFilter_Mp3 ( $sFile,
$aParams )
protected

Convert video to .mp4 format

◆ isMimeTypeSupported()

BxDolTranscoderAudio::isMimeTypeSupported ( $sMimeType)

check if transcoder suppors given file mime type

Reimplemented from BxDolTranscoderVideo.


The documentation for this class was generated from the following file: