Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:4440 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97240 invoked by uid 1010); 9 Sep 2003 08:47:16 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 97201 invoked from network); 9 Sep 2003 08:47:16 -0000 Received: from unknown (HELO alanathome.ossc.com.hk) (202.81.246.113) by pb1.pair.com with SMTP; 9 Sep 2003 08:47:16 -0000 Received: from devel ([192.168.0.40] helo=akbkhome.com ident=alan) by alanathome.ossc.com.hk with esmtp (Exim 4.22) id 19weAn-0007BB-QL; Tue, 09 Sep 2003 16:48:29 +0800 Message-ID: <3F5D9476.2050505@akbkhome.com> Date: Tue, 09 Sep 2003 16:51:02 +0800 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030520 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pollita@php.net CC: internals@lists.php.net References: <20030909081217.56868.qmail@pb1.pair.com> In-Reply-To: <20030909081217.56868.qmail@pb1.pair.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Two PECL Proposals [linux_oss] and [oggvorbis] From: alan@akbkhome.com (Alan Knowles) As mentioned on irc.. - the linux_oss are mostly ioctl calls, which might be worth adding as a generic routine to ext/dio like dio_fctl... however.. - it may be a rather large switch statement to deal with all the various type of inputs... that ioctl accepts... Anyone else want to add thoughts on that.. Regards Alan pollita@php.net wrote: > At urging of those who feel pear.dev is the wrong place to propose PECL > packages, I'm repeating my proposal here: > > ------------------------------------------------------------------- > > I'd like to propose two PECL extensions: > > 1) linux_oss http://frankenbox.alphaweb.net/test/linux_oss-0.1.tgz > > Description: Bindings for the Linux Open Sound System API. > > Functions: > linux_oss_buffer() : Setup DSP buffer on /dev/dsp or similar device > linux_oss_channels() : Set DSP to process number of channels (mono vs. > stereo) > linux_oss_rate() : Set sampling rate on DSP device > linux_oss_format() : Set sample encoding 8/16 bit, signed/unsigned, > big/little endian > linux_oss_mixer_query() : Probe capabilities of mixer > linux_oss_mixer_vol() : Get/Set volume on mixer channel > linux_oss_mixer_source() : Get/Set recording source > > Purpose: Control sound I/O on linux systems. Yes, this is platform > specific, but sound is a platform specific thing. I'll propose Windows > sound system bindings later, and ultimately bindings for Solaris and BSD as > I research them. > > Requirements: PHP >= 4.3.0, Linux w/ OSS kernel module and headers > > 2) oggvorbis http://frankenbox.alphaweb.net/test/oggvorbis-0.1.tgz > > Description: OGG/Vorbis fopen wrapper. > > ogg:// write - Encode PCM audio to OGG/Vorbis compressed audio. > > ogg:// read - Decode OGG/Vorbis compressed audio to PCM. > > > Example Usage: .ogg player > > dl('linux_oss.so'); > dl('oggvorbis.so'); > > $input = fopen('ogg://mymusic.ogg', 'r'); > $oggdata = stream_get_meta_data($input); > > /* Chained OGGs will be added as subsequent numericly indexed subarrays of > wrapper_data */ > $songdata = $oggdata['wrapper_data'][0]; > > $output = fopen('/dev/dsp', 'w'); > linux_oss_buffer($output, 8192); > linux_oss_channels($output, $songdata['channels']); > /* AFMT_S16_LE is the default output mode of ogg:// wrapper. > It can also be set to encodings listed above via a context option. */ > linux_oss_format($output, AFMT_S16_LE); > linux_oss_rate($output, $songdata['rate']); > > $mixer = fopen('/dev/mixer', 'w'); > > /* Master Volume L / R */ > linux_oss_mixer_vol($mixer, MIXER_VOLUME, 100, 100); > > /* DSP Output Volume L / R */ > linux_oss_mixer_vol($mixer, MIXER_PCM, 100, 100); > > stream_copy_to_stream($input, $output); > > fclose($mixer); > fclose($output); > fclose($intput); > ?> > > Requirements: PHP >= 4.3.0, libogg, libvorbis (both governed by BSD style > licenses) > -- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com