Ask a Question related to PHP Development, Design and Development.
-
Alan Knowles #1
Re: [PHP-DEV] Two PECL Proposals [linux_oss] and [oggvorbis]
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
[email]pollita@php.net[/email] 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 [url]http://frankenbox.alphaweb.net/test/linux_oss-0.1.tgz[/url]
>
> 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 [url]http://frankenbox.alphaweb.net/test/oggvorbis-0.1.tgz[/url]
>
> 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
>
> <?php
> 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?
[url]http://www.akbkhome.com[/url]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: [url]http://www.php.net/unsub.php[/url]
Alan Knowles Guest
-
Request for Shockwave 10 Content Proposals
Dear Developer, November is just around the corner, and this year?s U.S. Presidential election is heating up! I?m interested in finding out if... -
Changing the default font: 3rd of 3 FAQ proposals
Regularly, this forum has threads about changing the default font from Myriad. Especially one case proved extremely difficult, and a subsequent... -
When things disappear or become unavailable: 2nd of 3 FAQ proposals
This forum has many threads about strange and seemingly hopeless cases where things disappear or become unavailable. Most cases seem to have one of... -
Preserving/replacing the AIPrefs file: 1st of 3 FAQ proposals
I believe I have found a suitable way to: Create and use backup/custom AIPrefs files Amend corrupted settings without losing preferences (see... -
[ANN] RubyConf 2003: Call for Presentation Proposals
RUBY CONFERENCE 2003: Call for Presentation Proposals Proposals for full-length presentations (about 45-50 minutes) at the 2003 Ruby Conference...



Reply With Quote

