|
Home
iRate! IceMelon IM Tutorials Headlines CoolSites PHP Functions |
|
Most Referenced Functions » google_pagerank() » preg_replace() » imagecreatefrompng() » site_pageranks() » imagepng() » imagedestroy() » imagestring() » imagecolorallocate() » htmlentities() » preg_match() » fopen() » header() » getimagesize() » preg_match_all() » session_start() » htmlspecialchars() » ob_start() » ob_flush() » strstr() » flush() » strpos() » setcookie() » str_replace() » array2vars() » nl2br() » preg_split() » ereg() » ereg_replace() » urlencode() » readgzfile() Become a sponsor for $15/month. Link is sitewide - PR5 homepage, 20+ PR4 pages, 90+ PR3 pages. Email dave[AT]icemelon[D0T]c0m. |
PHP Functions
Function: ociwritetemporarylob (no version information, might be only in CVS) ociwritetemporarylob -- Writes temporary blobDescriptionbool ociwritetemporarylob ( string var [, int lob_type] )Note: This function was renamed to oci_lob_write_temporary() after PHP >= 5.0.0. For downward compatibility ociwritetemporarylob() can also be used. This is deprecated, however. IntroductionThe OGG/Vorbis file format, as defined by http://www.vorbis.com/ and http://www.vorbis.com/ , is a scheme for compressing audio streams by multiple factors with a minimum of quality loss. This extension adds Ogg Vorbis support to PHP's URL Wrappers . When used in read mode, compressed OGG/Vorbis data is expanded to raw PCM audio in one of six PCM encoding formats listed below. RequirementsThis extension requires PHP >= 4.3.0 , libogg >= 1.0, and libvorbis >= 1.0. Runtime ConfigurationThis extension has no configuration directives defined in php.ini . Installationoggvorbis is installed through the usual PECL package installation process.
$ pear install oggvorbis Copy the resulting oggvorbis.so to an appropriate location and add extension=oggvorbis.so to your php.ini file or load it dynamically in your PHP script using dl('oggvorbis.so'); Context optionsTable 1. OGG/Vorbis tuning options Option Definition Relevance Default pcm_mode PCM byte encoding used. See constants below. Read / Write OGGVORBIS_PCM_S16_LE rate PCM Sampling rate. Measured in Hz. Write only 44100 bitrate Vorbis Average Bitrate Encoding / Variable Bitrate Encoding. Measured in bps (ABR) or Quality level (VBR: 0.0 to 1.0). 128000 ABR is rough equal to 0.4 VBR. Write only 128000 channels Number of PCM channels. 1 == Mono, 2 == Stereo. Write only 2 serialno Serial Number of stream within file. Must be unique within file. Because of the potential to select a duplicate serial number within a chained file, make efforts to manually assign unique numbers when encoding. Write only Random comments Associative array of file comments. Will be translated to strtoupper($name) . "=$value" . Note: This context option is not available in oggvorbis-0.1 Write only array('ENCODER' => 'PHP/OggVorbis, http://pear.php.net/oggvorbis')Predefined ConstantsThe constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime. Table 2. OGG/Vorbis supports PCM encodings in the following formats Constant Definition OGGVORBIS_PCM_U8 Unsigned 8-bit PCM. OGGVORBIS_PCM_S8 Signed 8-bit PCM. OGGVORBIS_PCM_U16_LE Unsigned 16-bit PCM. Little Endian byte order. OGGVORBIS_PCM_U16_BE Unsigned 16-bit PCM. Big Endian byte order. OGGVORBIS_PCM_S16_LE Signed 16-bit PCM. Little Endian byte order. OGGVORBIS_PCM_S16_BE Signed 16-bit PCM. Big Endian byte order. Table of Contents Usage -- Examples on using the ogg:// wrapper. Usage Usage -- Examples on using the ogg:// wrapper.Examples
Example 1. Reading an OGG/Vorbis file
<?php
dl("oggvorbis.so");
/* By default, ogg:// will decode to Signed 16-bit Little Endian */
$fp = fopen('ogg://myaudio.ogg', 'r');
/* Collect some information about the file. */
$metadata = stream_get_meta_data($fp);
/* Inspect the first song (usually the only song,
but OGG/Vorbis files may be chained) */
$songdata = $metadata['wrapper_data'][0];
echo "OGG/Vorbis file encoded by: {$songdata['vendor']}\n.";
echo " {$songdata['channels']} channels of {$songdata['rate']}Hz sampling encoded at {$songdata['bitrate_nominal']}bps.\n";
foreach($songdata['comments'] as $comment) {
echo " $comment\n";
}
while ($audio_data = fread($fp, 8192)) {
/* Do something with the PCM audio we're extracting from the OGG.
Copying to /dev/dsp is a good target on linux systems,
just remember to setup the device for your sampling mode first. */
}
fclose($fp);
?>
Example 2. Encode an audio file to OGG/Vorbis
<?php
dl('oggvorbis.so');
$context = stream_context_create(array('ogg'=>array(
'pcm_mode' => OGGVORBIS_PCM_S8, /* Signed 8bit audio */
'rate' => 44100, /* 44kHz CD quality */
'bitrate' => 0.5, /* Midquality VBR */
'channels' => 1, /* Mono */
'serialno' => 12345))); /* Unique within our stream */
/* Open file for appending. This will "chain" a second OGG stream at the end of the first. */
$ogg = fopen('ogg://mysong.ogg', 'a', false, $context);
$pcm = fopen('mysample.pcm', 'r');
/* Compress the raw PCM audio from mysample.pcm into mysong.ogg */
stream_copy_to_stream($pcm, $ogg);
fclose($pcm);
fclose($ogg);
?>
XCIII. OpenAL Audio Bindings
IntroductionPlatform independent audio bindings. Requires the OpenAL library . InstallationThis PECL extension is not bundled with PHP. Additional information such as new releases, downloads, source files, maintainer information, and a CHANGELOG, can be located here: http://pecl.php.net/package/openal . You may download this PECL extension DLL from the PHP Downloads page or at http://snaps.php.net/ . Runtime ConfigurationThis extension has no configuration directives defined in php.ini . Resource TypesThis extension defines four resource types: Open AL(Device) - Returned by openal_device_open() , Open AL(Context) - Returned by openal_context_create() , Open AL(Buffer) - Returned by openal_buffer_create() , and Open AL(Source) - Returned by openal_source_create() . Predefined ConstantsThe constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime. ALC_FREQUENCY ( integer ) Context Attribute ALC_REFRESH ( integer )Context Attribute ALC_SYNC ( integer )Context Attribute AL_FREQUENCY ( integer )Buffer Setting AL_BITS ( integer )Buffer Setting AL_CHANNELS ( integer )Buffer Setting AL_SIZE ( integer )Buffer Setting AL_BUFFER ( integer )Source/Listener Setting (Integer) AL_SOURCE_RELATIVE ( integer )Source/Listener Setting (Integer) AL_SOURCE_STATE ( integer )Source/Listener Setting (Integer) AL_PITCH ( integer )Source/Listener Setting (Float) AL_GAIN ( integer )Source/Listener Setting (Float) AL_MIN_GAIN ( integer )Source/Listener Setting (Float) AL_MAX_GAIN ( integer )Source/Listener Setting (Float) AL_MAX_DISTANCE ( integer )Source/Listener Setting (Float) AL_ROLLOFF_FACTOR ( integer )Source/Listener Setting (Float) AL_CONE_OUTER_GAIN ( integer )Source/Listener Setting (Float) AL_CONE_INNER_ANGLE ( integer )Source/Listener Setting (Float) AL_CONE_OUTER_ANGLE ( integer )Source/Listener Setting (Float) AL_REFERENCE_DISTANCE ( integer )Source/Listener Setting (Float) AL_POSITION ( integer )Source/Listener Setting (Float Vector) AL_VELOCITY ( integer )Source/Listener Setting (Float Vector) AL_DIRECTION ( integer )Source/Listener Setting (Float Vector) AL_ORIENTATION ( integer )Source/Listener Setting (Float Vector) AL_FORMAT_MONO8 ( integer )PCM Format AL_FORMAT_MONO16 ( integer )PCM Format AL_FORMAT_STEREO8 ( integer )PCM Format AL_FORMAT_STEREO16 ( integer )PCM Format AL_INITIAL ( integer )Source State AL_PLAYING ( integer )Source State AL_PAUSED ( integer )Source State AL_STOPPED ( integer )Source State AL_LOOPING ( integer )Source State AL_TRUE ( integer )Boolean value recognized by OpenAL AL_FALSE ( integer )Boolean value recognized by OpenAL Table of Contents openal_buffer_create -- Generate OpenAL buffer openal_buffer_data -- Load a buffer with data openal_buffer_destroy -- Destroys an OpenAL buffer openal_buffer_get -- Retrieve an OpenAL buffer property openal_buffer_loadwav -- Load a .wav file into a buffer openal_context_create -- Create an audio processing context openal_context_current -- Make the specified context current openal_context_destroy -- Destroys a context openal_context_process -- Process the specified context openal_context_suspend -- Suspend the specified context openal_device_close -- Close an OpenAL device openal_device_open -- Initialize the OpenAL audio layer openal_listener_get -- Retrieve a listener property openal_listener_set -- Set a listener property openal_source_create -- Generate a source resource openal_source_destroy -- Destroy a source resource openal_source_get -- Retrieve an OpenAL source property openal_source_pause -- Pause the source openal_source_play -- Start playing the source openal_source_rewind -- Rewind the source openal_source_set -- Set source property openal_source_stop -- Stop playing the source openal_stream -- Begin streaming on a sourceRelated Function(s) |