WiseLoop PHP Web Media Grabber 3.1.1
Advanced PHP web resources extractor
wlWmgAudioGrabber Class Reference
Inheritance diagram for wlWmgAudioGrabber:

Public Member Functions

 __construct ($url, $fileExtensions=null, $checkContentType=true)

Static Public Member Functions

static getAudioFileExtensions ()

Data Fields

const AUDIO_FILE_EXT = '.au|.snd|.mid|.rmi|.mp3|.aif|.aifc|.aiff|.m3u|.ra|.ram|.wav'

Private Attributes


Detailed Description

WiseLoop Web Audio Grabber Processor class definition
This class is designed to retrieve audio media referred or contained by an url page and stores them in the $_validMedia array variable.
It uses the base class wlWmgProcessor capabilities to search an url page for audio links by checking its a href tags.
WiseLoop Web Audio Grabber main features:

  • smart audio recognition (common web formats and extensions, locations: under a href links or by content-type);
  • default native support for most common web audio extensions (au, snd, mid, rmi, mp3, aif, aifc, aiff, m3u, ra, ram, wav);
  • audio search and identification by the HTML content-type response header: the grabbing engine is able to identify more than the obvious audio resources having the most common audio file extensions - it will find the audio files that have no valid audio extesions or no extensions at all; the identification is made by checking the server response header when pinging the tested media resource;
  • audio files extension filtering: only those audio files having the specified extensions will be included in the grabbing results;
  • media url name (filename) filtering: only those audios having or containing in their url names some specified strings will be included in the grabbing results;
  • media size filtering: only those audio files having the specified size (in bytes) will be included in the grabbing results;
  • media count limiter: number of grabbed audios will be limited to a specified value;
  • HTML area searching: the grabbing engine is able to search for audios only inside a designated HTML area specified by a tag; in this way you can skip grabbing from the start any unwanted audios by narrowing the full HTML target page to a smaller area consisting of a tag content; an incomplete tag (tag slice) can be specified also, the tag will autocomplete depending on the contextual HTML content;
  • downloading capability: the WiseLoop PHP Audio Grabber is able to download the grabbed audios to the local server, so those files can be referred or used as local resources in the future;
WiseLoop takes no responsibility if the targeted url changes its tag structure or its HTML DOM tree, resulting in unexpected data retrieval; this will not be considered as malfunction or bug, and you should check the targeted url's HTML DOM tree for changes and modify the code that instatiates this class or any inherited classes.
Also, WiseLoop assumes no responsibility for any abusive use of this class and/or violation of terms of usage of the target url.
See also:

Constructor & Destructor Documentation

__construct ( url,
fileExtensions = null,
checkContentType = true 

Creates a wlWmgAudioGrabber object.

string$urlthe target page url
string | array$fileExtensionsaudio filename (extensions) filter; if string, the searched strings should be separated by '|' (ex. '.vaw|.mid|.mp3')
bool$checkContentTypeif true, the grabber engine will check also the content-type of the grabbed media to make sure it is an audio file

Member Function Documentation

static getAudioFileExtensions ( ) [static]

Returns the available audio files extensions


Field Documentation

$_checkContentType [private]

Type: bool - if true, the grabber engine will check also the content-type of the grabbed media to make sure it is an audio;
this checking will add some additional processing as headers for each possible media will be downloaded in order to perform the audio validation.
If false, the grabber engine will use only on the provided (or common) extensions for audio files and therefore the grabbing process will be faster but can bring non-audio files also.

$_fileExtensions [private]

Type: array|string - audio extensions filter; if string, the types should be separated by '|' (ex. '.wav|.mid|.mp3')

const AUDIO_FILE_EXT = '.au|.snd|.mid|.rmi|.mp3|.aif|.aifc|.aiff|.m3u|.ra|.ram|.wav'

Audio file extensions

The documentation for this class was generated from the following file:
 All Data Structures Functions Variables