[PHP] Audio stream piping minimal overhead

2009-03-07 Thread Richard Lynch
I'm interfacing PHP with an Asterisk server, and would like to pipe
audio into PHP, through sox, and back out, in real-time, thus with
*minimal* overhead in PHP.

Any suggestions on what would be the best architecture?

-- 
Some people ask for gifts here.
I just want you to buy an Indie CD for yourself:
http://cdbaby.com/search/from/lynch



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Audio stream piping minimal overhead

2009-03-07 Thread Nathan Nobbe
On Sat, Mar 7, 2009 at 10:35 PM, Richard Lynch c...@l-i-e.com wrote:

 I'm interfacing PHP with an Asterisk server, and would like to pipe
 audio into PHP, through sox, and back out, in real-time, thus with
 *minimal* overhead in PHP.

 Any suggestions on what would be the best architecture?


not sure if its what youre looking for, but a quick google turned up an
interesting class on PHP Classes.  The audio_streamer class.

heres what they have in the example file, which will stream it to the
browser as i understand.

?php
include 'class.audio_streamer.php';
$sound = new audio_streamer('./test.mp3');
$sound-save();
?

and heres a bit of the description,

*This class implements an alternative that takes advantage of pipes between
programs that are available under Unix, Linux and other systems, to execute
external audio manipulation programs.

This way, the resulting audio files can be streamed directly to the user
browser without any delays, and without taking too much server memory or any
disk space.

*-nathan